In this case the algorithm pegs the coin to another cryptocurrency, LUNA. You can algorithmically exchange 1 USD worth of LUNA for 1 UST at any time.
But note that this algo doesn't help you cash out your LUNA! Is 1 USD worth of LUNA really worth 1 USD if there is nobody who will buy it from you?
If there isn't a healthy USD-LUNA market, the fact that the UST-LUNA market is algorithmically enforced doesn't help you that much.
Algorithm won't help you make a healthy LUNA-USD market, only way is to have a market maker putting up USD and LUNA reserves to offer liquidity to buyers/sellers.