Now, when the companies are such that it makes some amount of sense to merge them together, that often does happen, and it can lead to tax efficiencies.
https://www.pwc.com/th/en/deals/transaction.html
> M&A transactions provide unique opportunities to improve tax efficiency.
M&A helps eliminating inefficiencies in cases where there are huge redundancies and excess capacity. (For example two big multinational conglomerates, both have at least one of eeeeeverything, HR, law, finance (bonds, insurance, stocks, investments, controlling interests), payroll, VAT/CIT/sales tax, supply chain management, operational risk management, security/compliance, IT. Plus all the actual business units, and usually big companies have some competing interests here and there, and simply eliminating one or the other (through unification, acquisition, or just closing the less profitable one) frees up resources and leads to better profitability.