I was able to amass ~$500k+ in liquid assets before 27 with a combination of attending a top college, not having any college loans when I graduated (worked hard all through college to make sure this was the case - parents are not wealthy), working at a startup that grew significantly for several years (significant equity upside), and investing everything I possibly could into the stock market over the past few years (greatest bull run in the country's history).
I also paid <$1500 a month for rent in SF for many years by living in converted rooms or having room-mates to keep costs low (relative to market rates). Many of my peers were paying >$2.5k-$3k to have their own spot. I was keeping expenses low and aggressively investing the difference in companies whose trajectories were all but inevitable in my opinion (+ some broad market index funds which have also done extremely well).
The weird thing about money is that once you get the flywheel turning (not easy), it compounds like magic given that you've made some good decisions.
My intent here isn't to boast. I figured you might appreciate a specific example of circumstances leading to building a modest level of wealth as a 20-something software engineer.
Involved was a lot of hard work, luck, timing, right place (SF), right company, good decisions, help from others, sacrifice, obsession, and a bunch of other things but I'll spare you the boring details. You could boil it _all_ down to luck if you'd like - but that's a bit too cynical for my tastes.