Although all Olympic sports require a great deal of skill and training to succeed, some have a larger element of luck than others. For example, swimming doesn't have a huge luck element. It is possible to identify a few small points where luck plays a role in the outcome, like getting off the starting block or having just the right stroke on the turns. Mostly, however, there is very little variation in a swimmer's time. The variation is very tight.
Gymnastics, on the other hand, is a comparatively high-luck sport. When a gymnast is on that four-inch balance beam, there is a lot of room for error. Whether an opponent falls or grabs the beam or fails to connect elements has a big effect on the outcome. And any single gymnast's scores will have a relatively wide range because the room for error is larger. This applies not just to a gymnast's own performance but also to their opponents' performances. You could be on average the second-best gymnast in the world, but on a given day you could crush the best gymnast in the world if they fall or just lose enough balance to throw off their performance.
I thought about this while watching gymnastics at the Olympics. In the run-up to the events, I heard all the talk about Simone Biles being certain to win the all-around gold medal. Certain? How could people possibly declare that? What if she falls off the beam and her opponents stay on?
Then I watched Simone Biles compete in the all-around. She beat her closest opponent, teammate Aly Raisman, by more than two points. To give you an idea of the magnitude of that gap, if you added together all of the margins of victory for the all-around since 1980, it would be less than the amount by which Simone Biles won. When the skill gap is so large, the influence of the luck on the outcome drastically diminishes. Biles' margin of victory was so great that she could have fallen off the balance beam (a full one-point deduction) and still won.
Generally, what you see in games of skill is that as you narrow the skill gap, the influence of luck in a single outcome becomes greater. If I play someone better than me at chess (which wouldn't be hard to find), I will lose likely every time. But if I play someone better than me by the same margin at poker, I have a good chance to win a given hand or a given match.
A narrower skill gap increases the influence of luck. This becomes clear if we think about the difference between a professional baseball team, like the Boston Red Sox, playing a Little League team, compared with another professional team, like the New York Yankees. Against the Little League team, the Red Sox will win every time. Against the Yankees, luck elements (umpire calls, where the sun is, rain, home field, etc.) will have a much great influence on a given outcome. This is why the World Series is determined by seven games rather than one, an attempt to discover which team is best by running the matchup more than once, to mitigate the elements of luck that influence the outcome. In a game that has little luck, like baseball, when the skill gap is narrow (as when two professional teams play each other) the influence of the luck elements is more prominent. That makes predicting the winner of a given game more difficult.
Generally, at the elite levels of a sport, it is rare for the skill gap to be so great that luck would not play a large role in determining the outcome, especially in a high-variance sport like gymnastics. What Simone Biles showed is that even at the elite levels of the game, it is possible to widen the gap enough to essentially diminish the influence of luck in such a way that one could predict the outcome of the all-around gold with relative certainty.
In every Olympic event, there are a lot of skills involved to getting your skill-gap that close, executing at the level where luck might have a larger influence. (And maybe a few times per generation there may be athletes so superior that even elements of bad luck aren't enough to keep them from winning.) Don't confuse the fact that luck might be having a large influence with believing the presence of luck lowers the level of skill.
"Luck" at the Olympics is treated like a dirty word. Luck just means "uncertainty" or "volatility." In most events, the extraordinary level of skill among the top competitors is so close that luck can make the difference. That's tough to swallow when you spend a decade preparing for an event that is decided in one day (and maybe just an instant). But this is how the world works, more like a gymnastics competition than a swim meet. You prepare and train so that in that crucial moment you are in a position to get lucky.
Unless you are Simone Biles. Then you just win.