Does it really make sense to hold USD if your only goal is liquidity? Maybe if you need it immediately, but honestly stocks and some other investments can usually be sold with the money accessible in seconds (or you can use credit). Really what I feel the value prop is for cash is low volatility (aka security as you mentioned).
With low inflation like we have seen in the past, risk adjusted it might be a better spot to hold that money relative to other investments. So yes, I hold a small portion of my portfolio in USD for that gain.
If it was not providing that low volatility (inflation spikes like crazy), then I'd be much less inclined to keep my money in USD outside of the minimum I'd need for immediate spending. Because returns are low. So the "gain" is in the risk adjusted return relative to other assets (which could ultimately be slightly negative).