On a Monday last month in a Delaware court, Elon Musk, facing yet another lawsuit by shareholders critical of how he has run Tesla, bemoaned that he “rather hates” being C.E.O. He’d be more content focused on engineering or designing electric cars.

The 50-year-old industrialist is nothing if not mercurial and contradictory. He may not like the boring parts of the chief executive’s job, but make no mistake: he sure as hell wants to control his company.

Today it’s hard to imagine Tesla without Musk. The two are intertwined, inspiring many to believe we’ve reached a new era of electric automobiles. That excitement has fueled investor enthusiasm, propelling Tesla to become the world’s most valuable car company despite its having earned a fraction of the sales and profits of some of its rivals. It’s also made Musk one of the world’s richest men.

A Tesla Model S during quality-control checks.

His history with the 18-year-old company has largely been defined by a fight for control—first to achieve it and then to keep it. Not content to remain on the sidelines as just chairman and its largest investor, Musk pushed out founding C.E.O. Martin Eberhard, whom he blamed for the company’s early troubles—cost overruns and missed deadlines—and replaced him with a string of successors before taking over himself in 2008, when Tesla was near the brink of collapse as it struggled to bring out the Roadster, the company’s first electric vehicle.

Then Musk oversaw a correction that saved Tesla and seeded a narrative of him as a Tony Stark–like character personally carrying the weight of the company on his back to ensure the success of a green-energy future.

Musk may not like the boring parts of the chief executive’s job, but he sure as hell wants to control his company.

Musk’s past efforts to find executives to help shoulder the management burden haven’t worked as smoothly as at his privately held SpaceX, maybe, in part, because the rocket-maker has less complex business operations.

Early on, Musk failed at recruiting to Tesla a hotshot engineer from Ford Motor Company named Hau Thai-Tang, who had gained attention for overseeing a successful Mustang redesign and would go on to become that automaker’s top product officer.

Later, Musk sought to bring aboard Facebook’s Sheryl Sandberg. She politely declined, recommending her late husband’s friend Jon McNeill, who became president overseeing global sales and service.

But at Tesla, potential successors, such as McNeill, tend not to last long. McNeill left in 2018 amid the company’s near-death experience of bringing out the Model 3, the sedan that today is fueling much of Tesla’s success. At the time, however, it appeared the troubled production ramp-up would finally bring down Musk after so many close calls.

The stamping press at the Tesla factory in Fremont, California.

The toil of overseeing both Tesla and SpaceX has taken its toll. In recent years Musk has talked about finding a different role at the company, one where he could focus on his passions. And in 2014 he publicly stated he was committed to staying on as C.E.O. of Tesla until the Model 3 went into production, which began in 2017.

As the company struggled with the production ramp, Musk pushed the Tesla board for an unprecedented pay package tied to ambitious growth and market-value goals over 10 years that would see him possibly receiving shares worth about $56 billion if fully vested.

It came with a few conditions. Musk needed to remain at Tesla, for one. But it allowed him to one day transition from the day-to-day duties of C.E.O. to roles as executive chairman and chief product officer. That latter position seemed like the kind of spot Musk had been publicly pining for—theoretically in control but not bogged down by the boring stuff.

But first he needed to get the Model 3 out.

Musk’s history with the 18-year-old company has largely been defined by a fight for control—first to achieve it and then to keep it.

Sensing Tesla was going to need to raise more money to weather Model 3 delays, his bankers at Goldman Sachs at one point urged him to meet with SoftBank’s Masayoshi Son, who was at the time launching a nearly $100 billion investment fund to supercharge disruptive tech companies. (Son was also the largest backer of Adam Neumann’s WeWork.)

The two men met in 2017 in a conference room overlooking the automaker’s Fremont, California, car-factory floor for a catered steak dinner. They never reached an investment deal, though. Son had a reputation for being hands-on with his investments, while Musk had long bucked at such arrangements. Instead, Tesla raised more money from public investors, who had shown little interest in reining in the company’s best spokesman.

Musk virtually attends a conference in Moscow earlier this year.

Still, being a publicly traded company came with its own challenges, such as shareholder lawsuits and vocal investors betting Tesla was overvalued. Those investors, so-called short-sellers, benefited if the company’s stock prices fell on negative news.

And, oh boy, did they get under Musk’s skin, taunting him on Twitter, where he seemingly spends his free time scrolling through their criticisms. It may have become too much in the summer of 2018, when Musk abruptly tweeted that he had secured funding to take Tesla private—beyond the reach of those annoying naysayers.

Only, Musk didn’t have a final deal in place. The idea soon died. The U.S. Securities and Exchange Commission took umbrage, calling the pronouncement a fraud and filing a lawsuit to bar him from running Tesla or any other publicly traded company.

While denying wrongdoing, Musk eventually cut a deal in September 2018 that let him remain as C.E.O. The catch? He had to give up his dual role as chairman for three years.

For the time being, to stay in control of Tesla, Musk must remain as C.E.O. But what’s in a title? He recently added a new one for himself: “Technoking” of Tesla.

Tim Higgins’s Power Play: Tesla, Elon Musk, and the Bet of the Century is out now from Doubleday