General Motors (GM) - Get Report played its cards shrewdly in negotiations with Unifor, Canada's largest labor union, coming to terms with labor on a four-year contract that will result in continued output from GM's Oshawa manufacturing complex.

GM had signaled to Unifor that it was willing to close Oshawa if terms of a new agreement were too onerous.

Late Sunday, the union issued a statement saying that 65% of its 4,000 members ratified the proposed contract reached earlier in the week, averting a possible strike that would have been costly for the automaker. Under the terms, GM agreed to invest about $420 million in upgrades, processes and new vehicle models at Oshawa.

GM, as well as the other unionized automakers in North America -- Ford (F) - Get Report and Fiat Chrysler Automobiles (FCAU) - Get Report  -- lately have been ramping up investment and production in Mexico, where lower costs, more flexible work rules and favorable trade agreements are turning the country into an automotive powerhouse.

Was GM bluffing? It doesn't matter: Since political, economic and market conditions change constantly, the No. 1 U.S. automaker needs a balanced manufacturing footprint across the continent that imparts maximum flexibility to source vehicle and parts production. Both sides said they are pleased with the agreement.

Imports from China, though quite small, also represent a potential threat to North American auto plants.

Canada, a traditional stronghold for automakers, has declined as a vehicle manufacturing base due to costly union wages, less flexible work rules, periodic labor militancy and currency fluctuations. GM recognized going into negotiations that the Canadian government of Prime Minister Justin Trudeau holds a political stake in maintaining automotive employment. Thus, the new labor agreement also will depend on undefined government subsidies and not just GM's promised investment.

Unifor was canny in its approach as well, emphasizing the goal of keeping GM's Oshawa plant open rather and protecting 4,000 jobs instead of pushing for a wage package or work rules that might have resulted in more job loss to Mexico.

The union now turns to talks with Ford and Fiat Chrysler. In all likelihood, the 2% wage increase and $6,000 signing bonus for GM workers will constitute a pattern for other autoworkers represented by Unifor.

"This government is the biggest champion of the auto sector that the province has probably ever had, and we've made it very clear that these are the kind of projects that we would partner on as we have in the past and we expect to in the future," said Brian Duguid, minister of economic growth and development in an interview with the Financial Post last week.

In return for GM's commitment, the union agreed that newly hired workers will be covered under a defined contribution pension plan, preferred by the automaker since it represents less financial risk, rather than traditional defined benefit plan typical for union workers.

"I think we were pleasantly surprised that the best-case scenario happened. My expectation was much lower," Flavio Volpe, president of Ontario's Automotive Parts Manufacturers Association, told the Detroit Free Press. "I think we were all surprised. At least I don't think anybody expected this outcome without going through the pain of a work stoppage, or at least a temporary work stoppage."

According to the Center for Automotive Research in Ann Arbor, Mich., Mexico has won nine of the last 11 new North American assembly plants built since 2011. All three of the unionized automakers have shifted production of small cars to Mexico in order to preserve their profitability, which is thinner in U.S. markets due to the rising popularity -- and stronger pricing -- of crossovers, SUVs and pickup trucks.

END

Doron Levin is the host of "In the Driver Seat," broadcast on SiriusXM Insight 121, Saturday at noon, encore Sunday at 9 a.m.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.