It's definitely a lot of luck - but don't think it's just that. Relentless drive and stellar performance in many different fields (tech, marketing, sales etc) is absolutely necessary and practically no amount of luck would help you without that. You have to keep trying to get lucky and be ready to take and milk the opportunity when it happens.
The luck is not in getting customers, though, especially not in B2C. That's just about product-market fit and marketing. I know people who can consistently do it again and again with any product or service that makes sense - and of course appropriate budget.
It's more about luck in B2B if you're just starting out, but again, I know people who can consistently sell anything that makes sense to the customers. They had to get lucky a lot at the beginning, but they went out, met people, pitched, and did it again and again. Do that for enough years and you build a network wide enough to just send a few messages and get clients immediately.
It's just numbers - there is a likelihood you'll meet a big client ready to buy, a likelihood you'll meet an investor today. It's about putting yourself out continuously, every day, to increase the odds you get lucky.
How many cold calls with prospective customers do you have daily? How often do you talk to people who might be interested on LinkedIn or other professional forums/social networks? How often do you attend in-person professional/networking events, conferences, tech talks? If you're not doing that at least few times a week, your odds are very low.