I agree with a lot of what has been said but would like to add that it is important to distinguish between risk capacity and risk tolerance, and that these two vary from person for person (this is why financial advisors are required to care about the suitability of the advice given to each client).
Even if a person has the capacity at 25 to go all into stocks, because they would objectively not need this money, it may nevertheless be a mistake to do so if this person does not have the risk tolerance for that much stock as well. Overlooking this can lead to emotion-driven reactions at the next crisis, selling at the worst possible time, and getting back to the market when it has already recovered. Having a risk-free part in the portfolio makes this more unlikely to happen.
The last major crisis is now more than 10 years ago. Many investors who recently joined the market have not yet experienced such a durable crisis and tend to underestimate the strength of will that it takes to go through them.
Am I forgetting 2020 and the lockdown? I am not: this year was special in many ways and markets went down faster than anytime in modern history last February and March. But we are now just a couple of months later, and the S&P 500 is already close to an all time high again, which can give a feeling of overconfidence. Also, this crisis is still ongoing and we do not know what will happen in the coming years after such a brutal drop of GDP and billions of people in a very difficult personal situation.
Crises, in the past, often involved markets going down a bit slower that what we saw in 2020, but durably over several years. Several years is a lot more than a couple of weeks. The temptation becomes increasingly high to sell in the middle of a drop with no end in sight, and many miss the recovery.
Of course, bonds have a risk too: inflation. And stocks do provide safety against it in the long term, but at the cost of high fluctuations. In the end, the choice of asset allocation is a personal decision that everybody has to make for themselves, and adjust with time, preferably between crises.