Luck is often a combination of the right connections, the right timing, and many other influences that cannot be predicted. Hard worktypically gets better results than you would with less effort.
Luck matters more in an absolute sense and hard work matters more in a relative sense. Absolute success is luck. Relative success is choices and habits.