In more detail
The 25 times figure comes from a 4% withdrawal rate: historical studies of US stock and bond returns found that withdrawing 4% of the starting portfolio, adjusted each year for inflation, usually lasted at least 30 years. Early retirees need money for longer than that, so many plan on 3–3.5%, which means 29 to 33 times spending. The main lever is the savings rate: the more of your income you save, the less you spend and the less you need. A "coast" number is the amount that grows to the target with no more saving.
Why it matters
The rule of thumb is a planning estimate, not a guarantee: a market fall in the first years of retirement does the most damage. Health insurance, taxes on withdrawals and decades of inflation are easy to underestimate.
Example
Spending $40,000 a year needs 25 × 40,000 = $1,000,000. Saving $40,000 a year from zero at a 5% real return reaches $1,000,000 in about 16.6 years. A 30-year-old who already has $231,377 invested at 5% real would reach $1,000,000 by 60 without adding another dollar: that is the coast number.