Whilst markets exist for selling shares in private companies, it’s harder and there is a smaller pool of people looking to buy.
On the public market, any shareholder can sell their shares (relatively) easily, and since it’s a public market the pool of potential buyers is much bigger.
Employees don’t automatically get money for their shares, being public just makes it easier for them to if they decide they want to.
The company could only use cash to do dividends or share buybacks, and the company is worth more than its cash on hand (maybe 10-20x as much more in Slack’s case.) A public offering makes it possible for effectively every shareholder to sell their shares for the full value without the company having to make a strategic financial decision to return cash to shareholders.