I absolutely agree that a lot of it comes down to luck, and I have said this repeatedly in my Born to Write magazine.
I've been published for 60 years - in South Africa, the UK, and the States. Those are the places I have lived and worked. I started writing on the web in 1999, so that gives me an advantage.
One of my articles which I first published about 8 years ago has had more than a million reads (not on Medium). It has a link to a book on Amazon, so that book sells steadily.
What I'm preparing to do is write a serial - a new chapter every dasy, and publish it on Revue, Google Play, Smashwords, Medium (only the first 30 chapters), Patreon, and Ko-fi, and wherever else I can find a platform. I will charge $3 or $4 per month and see how it goes.
Hopefully it will sell.