Companies don't really "buy" companies. That's just a mental model for a merger.
At its heart, it's a symmetric operation. The wealth of both companies gets divided among the owners of both companies, in proportion to an agreed valuation. You could say that Vizio is buying Wal-Mart. Either way, the combined management forms an agreement on who will be on the board and management roles after the merger, and what branding to use going forward.
"When I go to a store and buy an apple, I am not buying an apple, I am just entering into a symmetric operation, where my money goes to the store and the store's apple comes to me, based on an agreed valuation".