The risk-free rate is the opportunity cost of trading. When bills yield 5%, a strategy returning 6% with 20% volatility has produced one point of excess return for a great deal of anxiety, and the honest comparison says so.
It matters most inside ratios. excess-return is return minus the risk-free rate, and it is the numerator of the sharpe-ratio, the sortino-ratio and jensens-alpha. Ratios computed against a zero rate - common in retail tools and in backtests built during the 2010s - are inflated, and the inflation is exactly the prevailing yield. A Sharpe of 1.0 computed against zero when bills paid 5% is not 1.0.
It also changes the arithmetic of holding cash. When cash pays nothing, sitting out is free; when it pays 5%, sitting out earns, and marginal strategies stop being worth running at all.
Related: excess-return, sharpe-ratio, jensens-alpha, risk-adjusted-return