On a recent Tuesday afternoon, Jim Farley, the chief executive of Ford Motor, took a spin in an electric F-150 pickup truck, which could become one of the most important vehicles in the company's 113-year history.

Mr. Farley floored the prototype at the company's test track. He shouted when the truck reached 60 miles per hour.

Steering the truck to a series of dips and rises in the track, he said, "Let's see if we can get some air." He careened around a steeply banked turn and floored it again on a straightaway, just short of the track's 100 m.p.h. speed limit.

Mr. Farley shook his head as he stepped out.

The auto industry is tense and exciting. Sales of electric vehicles seem to be on an unstoppable rise. The switch from making gasoline-powered cars and trucks to electric vehicles that emit no pollution from tailpipes will have far-reaching effects on the environment, climate change, public policy and the economy.

The auto industry is spending tens of billions of dollars to retool plants and is rushing to retrain workers for what may be the industry's greatest transformation since Henry Ford's moving assembly line in 1913. They are trying to catch up to the company.

The question for Ford is whether a car guy from the Detroit area can take on Musk, whose company is rapidly expanding and is valued by investors at 16 times as much as Ford.

Last year, the company sold almost one million cars around the world. Ford sold nearly four million vehicles in the last year, but sales fell as it struggled to get enough computer chips, batteries and other parts. People associate the brand ofTesla with luxury and technical sophistication. Ford is a maker of trucks and SUVs.

Earl J. Hesterberg, the chief executive of Group 1 automotive, said that the traditional auto industry was far behind. The speed of change is greater today.

If Ford is to thrive in the age of electric vehicles, the electric F-150 must be a success. William C. Ford Jr., the company's executive chairman is a great-grandson of Henry Ford.

The company has 200,000 reservations for the trucks. The global chip shortage and rising costs of raw materials crucial to batteries could slow production. The sales of a new electric Volkswagen in 2020 were hampered by a flaw in the software that Ford developed for the truck.

There are some things going for Ford and Mr. Farley. The F-150 Lightning is relatively affordable, starting at $40,000. The cheapest car is the Model 3 sedan, which starts at more than $50,000. The large front trunk of the Lightning is appealing to families and businesses with large truck fleets. It helps that the Cybertruck will not be made until next year.

The mustang Mach-E is an electric sport utility vehicle. In its first year on the market, it had sales of more than 27,000.

The production of the F-150 will start next week. Ford's main rivals in pickup trucks are at least a year away. Ford invested in Rivian, a new manufacturer that is struggling to increase production.

Mr. Ford said that if the launch goes well, they have an enormous opportunity.

When it comes to leading a large U.S. automaker, Mr. Farley checks most of the boxes. Mr. Farley's grandfather worked at a Ford factory, and like Mary T. Barra, he is the chief executive of G.M. He would visit Ford plants and other sites important to the company's history on his visits to his grandfather. While working in California as a teenager, he bought a car and drove it to Michigan without a license. His grandfather used to call him Jimmy Car- Car.

Like Mr. Musk, Mr. Farley has had a varied career and has been involved in creating businesses. He was born in Argentina and lived in Brazil and Canada as a child. His career began at IBM. He was at Toyota for a long time. He helped the Japanese automaker overcome its reputation for making boring and economical cars by working on its Lexus luxury brand.

Jim Press is a former senior executive at Toyota and Chrysler. He pushes beyond what others think because of his boldness.

Mr. Farley has family roots in the automotive industry.
ImageMr. Farley has family roots in the automotive industry.
Mr. Farley has family roots in the automotive industry.Credit...Sylvia Jarrus for The New York Times

Alan R. Mulally hired him to help turn around Ford. He ran the European operations of the company and made early use of Facebook and social media.

Mr. Hesterberg bristled at his intensity. Business as usual isn't going to cut it because the traditional auto industry is behind the company.

In the last few years, Mr. Farley visited technology companies in California and realized that they were after Ford's customers.

Ford was at risk of falling behind in electric cars and pickup trucks because of a brain trust that saw it. Ford decided to modify an existing F-150 and buy batteries from a supplier instead of building a new electric truck. The move was risky because converting traditional vehicles to battery-powered ones can be difficult, and batteries weigh more than engines and are placed under the floor.

We didn't know how this would turn out, but we knew there would be a heavy penalty if we didn't swing for the fences.

The first estimate for how many Lightnings it would sell was 20,000 a year. The estimate was low because of the growth of the company and the plans to build two giant factories.

In part because of his team's lowball estimate for Lightning sales, Mr. Farley said he was increasingly convinced that Ford needed to transform itself.

Many auto executives acknowledge that one of the main advantages of the company is that it is far ahead of established automakers in developing software that operates its motors, manages it batteries, and informs and entertains drivers and passengers. Because of this,Tesla makes cars that go farther on a full battery than cars made by almost anyone else.

Ford and other established carmakers have only recently begun using the ability to remotely update the software in their cars. Most cars made by established manufacturers have to be taken to dealers for minor repairs.

Mr. Farley is worried about the potential for software bugs in the millions of lines of code.

He said that they have been trained to put vehicles out when they are perfect. The quality system isn't used to this orientation.

Ford needed to beef up its software chops so much that Mr. Farley spent months recruiting Doug Field, who has held senior positions at both Apple andTesla, to join the company.

Mr. Field said in an interview that he was drawn by the chance to build a technology team at a company with a century of expertise in engineering and manufacturing.

Ford Blue will continue making internal combustion models, while Model E will develop electric vehicles.

Mr. Farley's strategy has been supported by investors. Ford stock traded as high as $25 before Russia's invasion of Ukraine, but has fallen back to about 15. Ford's market value is now greater than that of G.M., which has been the largest U.S. automaker.

Wall Street thinks that companies like Ford, worth $62 billion, and G.M., $58 billion, will become relative minnows, despite the fact that they are worth more than $1 trillion.

Most of Mr. Farley's days are spent on the Lightning. He pulled out his phone and scrolled through a long email he gets every evening, with updates on every facet of the launch.

Workers on the production line of the 2022 Ford F-150 Lightning.
ImageWorkers on the production line of the 2022 Ford F-150 Lightning.
Workers on the production line of the 2022 Ford F-150 Lightning.Credit...Sylvia Jarrus for The New York Times

Mr. Ford received an email late in the evening from Mr. Farley, who was nine time zones away in Germany.

There is a big concern about computer chips. A shortage of auto parts has disrupted production around the world for more than a year, and a few hundred gasoline-powered F-150 trucks are parked and waiting for a minor but crucial component, which is delayed for the want.

Mr. Farley took an hourlong tour of the assembly line to see how much work remains.

At a section of the production line, he was shown new robotic, self-guided skids that carry the steel bed from one work station to the next. There is no need for an overhead conveyor system with the skids.

Bill Dorley told Mr. Farley that his crew was ready to go.

The building that produced the Ford Model A was demolished to make room for the expansion of Lightning production.

Workers waved and shouted greetings as Mr. Farley moved along the assembly line.

Mr. Farley asked how they were doing and what they needed.

Michael Johnson, who will bolt in the Lightning's suspension system, highlighted one of the central concerns that many manufacturing workers have about electric vehicles: jobs. Electric vehicles can be made by fewer workers. Mr. Johnson was concerned about a truck plant that Ford is building in Tennessee, a state that has been less welcoming to unions like the one that represents workers in Dearborn.

Mr. Johnson asked if the plant was going to be safe.

The Tennessee plant would build a different truck. He said that Ford was going to start making its own electric vehicle parts, rather than buying them from suppliers.

Ford's future depends on that being the case.