Detroit-based automakers avoided a costly work stoppage by agreeing to give tens of thousands of workers pay raises and big bonuses.

The threatened walkout by the United Auto Workers union would have come at a time of peak consumer demand for General Motors (GM) - Get Report , Ford Motor (F) - Get Report and Fiat Chrysler Automobiles  (FCAU) - Get Report vehicles, so the companies didn't want to lose production. 

Higher pay in Detroit could boost the Mexican economy as well. That's because the higher cost of union labor means GM, Ford and Fiat Chrysler will have an incentive to accelerate car production in Mexico, while limiting output in UAW strongholds like Michigan and Ohio to the manufacture of pickups and SUVs. Cars, which sell for lower prices than pickups and SUVs, need Mexico's lower labor costs to improve profitability.

Fiat Chrysler, for example, has said it will move the Chrysler 200 to Mexico and consolidate Ram pickup production in Michigan.

On Monday, Ford became the last of the three Detroit automakers to reach a tentative agreement with the union. Jimmy Settles, Ford's bargainer of the UAW blessed it: "This agreement is significant for our members in that it creates a clear path for economic advancement for active members and rewards veteran employees for their sacrifices in recent years."

Kristin Dziczek, an analyst with the Center for Automotive Research in Ann Arbor, Mich., said: "In 2011, the UAW traded wage gains for jobs and it paid off big time. This time, wage gains were the priority, and that is likely to result in lower job growth in U.S. plants." Several auto executives, speaking on the condition of anonymity, agreed with her.

The point was further hammered home this week by the Japanese maker of Subaru automobiles, Fuji Heavy Industries Ltd. (FUJHY) - Get Report , which said it will build its replacement for the Tribeca in the U.S., not Japan. Fuji is expanding car production in the Midwest at its non-union plant in Lafayette, Indiana. The automaker announced a $140 million expansion of its plant in September and the hiring of 1,200 new workers. Average wage for the new workers: $17 an hour.

Under the new UAW contract in Detroit, worker wages will eventually be raised to nearly $30 an hour, fulfilling the goal of the union, the companies and many workers to reconcile the industry's two-tier wage structure. The UAW had reluctantly agreed to a second, lower wage in 2007 to relieve the automakers' financial burden. GM and Chrysler filed for bankruptcy in 2009 and were reorganized and refinanced by the U.S. Treasury.

Predictions can be tricky, especially in as cyclical an industry as automotive manufacturing. The UAW, having this year avoided a strike and toned down its rhetoric, may finally succeed in organizing non-union auto plants and gaining new members with the lure of higher wages established in the latest contract.

But dissenters will point to Mexico's growing auto industry and perhaps to the Subaru plant in Indiana, where job security and a steady growth of the work force depend on a market-based wage.

Shares of General Motors closed Wednesday at $35.55, a slight decline of less than 1%. Ford closed at $14.31, a rise of less than 1%. Fiat Chrysler finished the day at $13.95, down by less than 1%.

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

The writer has no financial interest in the aforementioned companies.