They do both. It's relatively rare for a company to IPO without raising fresh capital for the company. There are however often "secondary" share sales where only "selling shareholders" (rather than the company) receive the proceeds.
An IPO without raising new capital would make it more difficult to answer what every buyer should ask: "why are they so eager to sell?" It's a variation of plausible deniability.