If you study hard and get good grades, you might find yourself in a position where someone needs to hire for a role that you're already prepared for. Sure, there's luck in bumping into that person, but you worked hard to be able to take advantage of opportunities, so I'd say luck had very little to do with your success. If it wasn't this lucky break, there would be another one.
If you brush off school and happen to get hired by a boss that could care less if you do work of any quality, that's mostly luck and probably not repeatable.
Sure, Gates and Bezos experienced luck during their careers, but I'd be willing to bet that the dominant trait in their growth was hard work and intelligent decision making. Some people like to think of them as happening to be in the right place at the right time, but I think they worked hard to prepare themselves with the skills necessary to see those massive opportunities and were obsessed with moving as fast as possible towards their goals.
It's not as if the qualifications are simply to be smart and hard-working, and then a random drawing is held to determine the winner.
Instead, there are countless micro-decisions and actions that go into execution. The likelihood that any two people are executing an idea in exactly the same way is vanishingly small, even if they are both smart and hard-working.