GM posted a 38.7 billion dollar loss in 2007, and would have entirely run out of cash by mid-2009 if they didn't merge, receive government funding, or were able to sell their assets. GM was forced into Chapter 11 Bankruptcy, despite attempts to get government loans while both Presidents (Bush and Obama) were in the White House. In order to restructure GM, and save the majority of the company, the US bought GM's assets for about 50 billion, which equated to about 60% of GM. That saved about 209k jobs around the world and the majority of those workers were in the US. That along with the fact that special tax provisions allow GM to take the losses they incurred dating all the way back to 2006, and carry them forward to reduce their tax liability. (About 45 billion over the course of 20 years)
Yes, the Government owns 27% of GM despite GM filing the largest IPO in history. GM had been in a joint venture with Shanghai Automotive Industry Corporation since 2007 which is one of the largest Automakers in China. SAIC had already been making Chinese-built Buicks since 1997 under Shanghai GM. Shanghai Automotive has invested 500 million into GM, which equates to about 1% of the company.
The reality is that it's Capitalism. It doesn't matter to the US government who buys the shares, because the Government isn't designed to own and operate an Automotive company. As a matter of fact, the entire standard of Financial Reporting is going from US GAAP to IFRS, which is because the SEC wants to allow foreign investors greater transparency to invest in US corporations.