M&A deals are analyzed pretty closely and there (usually) has to be a convincing argument that it is economically or strategically accretive to the acquirer. It's easy to call them all morons from afar, but I think it just highlights how difficult it is to pull off successfully. And when it is successful, it's always an obvious no-brainer in retrospect.

Anecdotally, I know someone that spent two years intentionally sabotaging an M&A deal that would replace his internal product and team in a company. He and his colleagues were successful and everyone thinks the acquirer was a dumbass for doing it, but with more knowledge about the misaligned incentives it starts to become more clear.