If you buy both sides of the bet, you can void them and use your money elsewhere. That's what provides liquidity.
To sell a bond, you do have to find a buyer with cash, so the same logic applies there. You might hold some amount of cash in your portfolio so that you are able to take these opportunities.
Another analogy is that buy Yes is like buying insurance, and buying No is selling insurance (to invest the proceeds). If the insurer wants to exit their position, they must either sell their 'No' to somebody esle or balance the deal with another insuree/Yes who is also willing to exit.
Another thing is that Polymarket rewards people providing liquidity to illiquid markets, so Yes positions are further subsidised, possibly being nearly free.
It's basically a way to transfer money from people who think prediction markets are about making predictions to people who enjoy exploiting counterintuitive properties of financial instruments. Of course the house always takes a cut, too.