On Tuesday morning, Ford Motor Co. announced it would scrap a plan to invest $1.6 billion in a new production plant in Mexico and instead plow $700 million into the Flat Rock Assembly Plant south of Detroit, which will add 700 jobs.

It is tempting to see the move as a proactive response to President-elect Donald Trump’s propensity to call out U.S. companies moving production overseas. Earlier Tuesday morning, Trump was zinging General Motors on Twitter for producing the Chevrolet Cruze in Mexico and allegedly shipping them across the border. (GM says it only ships about 4,500 Cruzes per year from Mexico to the U.S.) In his announcement, Ford CEO Mark Fields did cite the “pro-growth policies that President Trump and the newly-elected Congress have proposed” as a reason for the investment.

But Ford’s announcement is primarily a response to market forces that have been underway for years. And it is inspired in part by explicit policies of the George W. Bush and Barack Obama administrations—the fruits of which Trump will almost certainly take credit for.

As a general rule, U.S. car companies prefer to make cars that are big, expensive, or technology-laden—ideally all three—because the sticker prices are higher and the profits margins are much greater than those associated with cheap, small cars. On a percentage and absolute basis, carmakers tend to make much higher profits on SUVs and pickup trucks that cost $40,000 or $50,000 than on a car like the Ford Focus, which starts at about $17,000.

When the economy is doing poorly and gas is very expensive, manufacturing and sales strategies that center around expensive, low-mileage cars are a recipe for disaster, which is one of the reasons Ford, General Motors, and Chrysler ran into so much trouble in 2007 and 2008. But when the economy is going well, when lots of people have jobs and incomes are rising, and when gas is very cheap, selling those big, pricey, tech-filled cars is a really good strategy. And regardless of how the U.S. economy is doing or where gas prices are, it is making less and less sense to build very cheap cars in the U.S. where fixed costs are high. So it’s not surprising that Ford is pushing more production of the Focus to Mexico and investing in greater capacity to produce expensive, large vehicles in the United States.*

Another set of competitive pressures underway for several years is pushing further bifurcation in North American auto manufacturing: low-margin, cheap, basic cars made in Mexico largely for the local market, and expensive, gadget-laden vehicles made in the U.S. largely for the U.S. market. Beyond simply building larger and more expensive vehicles, U.S car manufacturers are seeking to profit and keep up with competition by adding more technology—specifically, greater electrification and autonomous capabilities. “The era of the electrified vehicle is dawning, and we in Ford plan to be a leader,” Fields said in Tuesday’s announcement. The Flat Rock plant, he promised, would build an all-electric SUV with a range of 300 miles as well as fully autonomous hybrid and electric vehicles. Henry Ford’s company is transforming into “both an auto and mobility company,” he said.

Here, again, it is logical for U.S.-based car companies like Ford to make such investments in the U.S. rather than Mexico. Electrified and autonomous vehicles tend to cost a lot more than their old-fashioned counterparts and require more sophisticated R&D and assembly lines. Manufacturers in the U.S. must comply with local clean-air and mileage mandates. And in the past several years, thanks to an explicitly mercantilist and economically nationalist policy of the Obama administration—one that was much reviled by Republicans—Ford has invested significant sums in vehicle electrification and battery research and production.

As part of the highly successfully Department of Energy Loan Guarantee Program, which actually began under the Bush administration, loans were made available to automakers and suppliers to work on batteries, electrification, and fuel efficiency. One of the automakers that took a loan, Fisker, failed, costing the taxpayers $139 million. Tesla repaid its $465 million loan, in full and with interest, nine years early. Ford was the only one of the Big Three to participate. It borrowed a hefty $5.9 billion in 2009 and used the money to upgrade 13 factories in the U.S., and revamp its assembly lines and supply chains so it could produce the F-150 pick-up truck with an aluminum body and develop the eco-boost engine. Ford has been paying back the loan and as of Sept. 30, 2016, had a balance of about $2.27 billion.

Put another way, several years ago Ford took a boatload of government money and promised to spend it on research, development, and processes that would give it the know-how and capability to produce electric and electrified cars in the U.S.—and only in the U.S. And it has delivered. It’s little noticed, but each month Ford’s plug-in hybrids, the C-Max Energi and the Fusion Energi, sell more units combined than the Chevrolet Volt. Armed with the experience, technology, and platforms it has built in the last several years, Ford is plunging ahead into an electrified future. Fields announced Tuesday that the company would introduce 13 electric vehicle models in the next five years, and would soon be producing hybrid versions of its iconic Mustang and Ford-150 in the Detroit area.

So, sure, you could thank Trump that these American cars are going to be made in America. But you should thank Bush and Obama first.

*Correction, Jan. 3, 2017: Due to an editing error, this article originally misstated that Ford Motor Co. is pushing production of the Chevrolet Cruze to Mexico. It has been moving production of the Ford Focus to Mexico. (Return.)