It's true, many great players come from Africa, but no national team has the depth of their squad, with talented players in every position. I think that's why African countries often fail at the World Cup, especially when they reach the knockout stage. According to the FIFA rankings, Morocco, Senegal, Egypt, Algeria, and Nigeria are currently among the top five African national teams. As we know, these teams boast star players from elite European clubs, but one or two star players aren't enough to lead a team to the World Cup trophy. Morocco journey in the last World Cup was, in my opinion, impressive.
https://inside.fifa.com/fifa-world-ranking/menSquad depth is indeed an important factor for a national team to compete well in the world cup. Because if a national team has only a few star players, then what happens is that when the player is injured, the team does not have a replacement and it will have a significant impact on the team's performance. Having squad depth also allows the national team to divide their playing proportion, make good rotations, and tactics that can be adjusted to the players. And because of this, the European national teams can compete better, because they not only have squad depth, but also mature tactics and game systems as well as a supportive football infrastructure from the grassroots to the highest level.