General Motors might be the largest U.S. automaker, but it could not survive in Europe

General Motors sold off its European brands two years ago, ending a 90-year legacy, but also roughly two decades of losses.

General Motors(GM) had been trying to make it in Europe for 90 years before it gave up. 

In 2017, GM finally shut the door on the continent after roughly 20 years of losses. and sold its struggling Opel and Vauxhall brands. The move was part of a larger strategy to focus GM's attention on its profitable business selling trucks and sport utilities in the United States, and

GM struggled with high production costs it was never able to control, and had was making cars customers didn't really want to buy.

To be fair to GM, there were not the only company that struggled in Europe. Its American rival Ford(F) has also dialed back its European presence, and focusing on markets where it is most profitable.

"American cars just have never really sold very well there." said CFRA analyst Garrett Nelson. The European market is a fragmented one made up of several countries, and it is dominated by European brands, such as the three major German manufacturers BMW, Mercedes-Benz, and Volkswagen.

There were other factors that hampered the automaker in the region, such as the financial crisis, and an ever tightening regulatory regime around emissions and fuel economy.

So the automaker sold the business to PSA Group, the French automaker that owns the Peugeot and Citroen brands.

The move was risky. Europe, taken as a whole, is a large market nearly the size of the United States in terms of new car sales. By pulling out, GM was losing an opportunity to sell a lot more cars around the world, and was increasing its exposure to risks in North America.

It was also costly. GM spent more than $6 billion ridding itself of the business, causing the company to take a $3.9 billion loss in 2017.

But jettisoning its Opel and Vauxhall brands gave GM's bottom line a boost. In the two years following the sale, GM's earnings from its global auto business were more than 8 percent, compared with just above 2 percent in the decade before.

"At the time is was the right move and a win-win for PSA, Opel, and GM. At this point is appears to be working out that way," GM told CNBC.

See more: 
• Why Buick does so much better in China than it does in the U.S.
• Toyota, Nissan, and Honda dominate in the US, but American brands struggle to sell in Japan
• Walmart flopped in this country in South America - here's why