Investments come with risks. The trade-off of cash losing its value over time is that it’s relatively less risky. You split your assets into cash and investments to achieve an overall combined risk profile. In that sense, cash is just another investment with a certain risk-return ratio (even when the return is negative).
Your cash over time is guaranteed to lose almost all its value. While, if you invest in something, it could be even gold or silver, could be a house, could be a global market cap index fund, it holds more of its value than a fiat currency does. So no, fiat currencies lose everything and even with risks involved with other investments, the risks are still less than cash. Cash over time is one of the worst investments.
It depends on your time horizon. Over a period of say ten years, cash is unlikely to lose almost all of its value, whereas for stocks the likelihood can be higher. The stock market may crash (like it has in the past) at an inconvenient moment where you’ll then be happy to have some cash on hand.