From ketchup to batteries to insurance, Berkshire Hathaway, Mr. Buffett’s firm, invested in or took over dozens of companies.