For the last decade, many Apple employees working on the company’s secretive car project, internally code-named Titan, had a less flattering name for it: the Titanic disaster. They knew the project was likely to fail.

Throughout its existence, the car effort was scrapped and rebooted several times, shedding hundreds of workers along the way. As a result of dueling views among leaders about what an Apple car should be, it began as an electric vehicle that would compete against Tesla and morphed into a self-driving car to rival Google’s Waymo.

By the time of its death — Tuesday, when executives announced internally that the project was being killed and that many members of the team were being reassigned to work on artificial intelligence — Apple had burned more than $10 billion on the project and the car had reverted to its beginnings as an electric vehicle with driving-assistance features rivaling Tesla’s, according to a half dozen people who worked on the project over the past decade.

The car project’s demise was a testament to the way Apple has struggled to develop new products in the years since Steve Jobs’s death in 2011. The effort had four different leaders and conducted multiple rounds of layoffs. But it festered and ultimately fizzled in large part because developing the software and algorithms for a car with autonomous driving features proved too difficult.

Apple declined to comment.

“When it started, it was aligning the stars on something Apple alone could hit a home run on,” said Bryant Walker Smith, an associate professor at the schools of law and engineering at the University of South Carolina, who spoke to Apple briefly about its project in 2015. “A decade later, the stars have realigned to make this a lot of risk and not a lot of gain.”

When Apple launched its car project in 2014, it was among a stampede of investors, executives, engineers and companies chasing the idea of a self-driving car. After Google began testing prototypes on public roads in California, voices across Silicon Valley insisted that autonomous vehicles would soon be commonplace. Apple didn’t want to be left behind.