It’s not like Salesforce could have even bought a large percentage of the shares when they went on offer. You don’t make 100% of the company available.
Sometimes companies ipo to prove to buyers that they believe their market value is higher than potential buyers think. I can’t speak for Mulesoft but their stock has been mainly excellent and their transition to a public company has been fantastic.
Mulesoft brought a great company to market and Salesforce was willing to pay a 23% premium. Mulesoft thought that was fair - today.
As irrational as it sounds (and it is), companies overwhelmingly prefer to chase strength in acquisitions. It makes everything about it look and sound better. They don't care about the cost difference, it's not their money/value being vaporized. They care about protecting their job, so they want positive optics, something that is perceived to move the needle on value.
Presumably, there was a reason.
Usually in a big-enough company the least efficient thing happens instead of the most efficient thing. But the advantage of the big company is that it can play bigger games than your average small company. And if a small company succeeds at playing bigger then you can still buy it. So despite what HR and your manager might tell you, efficiency is not as important for survival.
This is going to be really good for system integrators as Mulesoft is a complex platform that requires hours of consulting. If I was in the Salesforce space I would be signing up to Mulesoft courses and getting my guys all over that.