Facebook has spent years integrating Instagram and WhatsApp: weaving their ad systems, user profiles, databases and other technology with Facebook. What to the public appear as distinct products are one giant social network on the back end.

Today, those technical and strategic decisions — part of chief executive Mark Zuckerberg’s vision of seamless communication across platforms — add enormous complexity to the possibility of breaking up Facebook’s conglomerate of apps, as antitrust lawsuits from 48 U.S. states and territories and the federal government aim to do.

But the technical blending of apps was also the source of major clashes within the company, said six people familiar with the matter who spoke on the condition of anonymity to freely describe sensitive internal matters, and was a way to help control Facebook’s costly acquisitions of companies with independent-minded founders. Officials accuse Facebook of being an illegal monopoly that has hampered innovation and engaged in anti-competitive behavior.

“Instagram is no longer viable outside of Facebook infrastructure. They spent six years moving things over,” said Dmitry Borodaenko, a former Facebook engineer who worked on Instagram infrastructure. “They just can’t undo it with a click of a button. It would take years.” Borodaenko said he believes the companies should be broken up.

Spinning off WhatsApp, which is still far less intertwined with Facebook, would be more like a six-month technical project, said two people familiar with the company’s systems who requested anonymity to speak freely. Another person familiar with WhatsApp who spoke on the condition of anonymity to describe sensitive legal matters pointed out that the service now provides a billion calls and 100 billion messages each day — all running on Facebook’s infrastructure. Unwinding that while preserving reliability could also take years, this person said.

Facebook merged its technology with WhatsApp and Instagram not only in the name of efficiency and sharing engineering resources and maximizing growth. It was also a way to collect even more data about users and generate more advertising dollars — though some of Facebook’s integration plans were stymied several years ago when the European Union began investigating the WhatsApp acquisition.

Zuckerberg’s long-standing vision has been to make text messaging between platforms as simple as communicating with someone who uses a different email provider, according to interviews and people who work with him.

Facebook declined to comment. The company said Wednesday that the Federal Trade Commission’s actions would hurt innovation and that the acquisitions had been reviewed by regulators at the time, including the FTC. The company also pointed out that its investments and acquisitions have helped billions of people access useful technologies.

If Facebook were to be broken up, it would be incredibly rare and would probably take many years and long legal battles. The last time the government broke up a monopoly was in the early 1980s, when it forced AT&T to spin off the regional telecommunications network known as the Bells. In 2000, a judge decreed that Microsoft, which had already been found to be an illegal monopoly, should be split into two halves. But Microsoft was never split up because later courts reversed the decision.

But Facebook’s greatest asset is the data it has on billions of people. There has never been a major breakup of a company trading in data.

In 2019, Zuckerberg announced a major strategic push to get Instagram, Facebook and WhatsApp to talk to one another, touting a concept known as “interoperability.”

Since then, the company has embarked on an extensive technical project to allow people on Facebook to message someone directly on WhatsApp or Instagram, without having to open a separate app. The company believes this will make communication easier and encourage people to spend more time on the service.

This September, Facebook launched a pilot integration between Facebook Messenger, its homegrown messaging platform, and Instagram.

The project to integrate WhatsApp will take years, people familiar with the effort said. That is because WhatsApp is end-to-end encrypted — meaning it has different privacy and security standards than Facebook’s Messenger — and because WhatsApp collects people’s phone numbers and does not require a username. While Facebook knows, in some cases, which WhatsApp numbers connect to Facebook profiles, it is still working on building a system that would enable a person with just a phone number on WhatsApp to talk to a Facebook user who has not provided a number.

Long before Zuckerberg announced his interoperability push, Facebook had already been hard at work on merging Instagram and WhatsApp with its core social network.

The goal was growth and engagement, or getting people to spend more time on the company’s services.

Instagram’s growth was supercharged by its integration with Facebook, which happened almost immediately after Facebook bought the company for $1 billion in 2012. The “Instagration,” as it was known internally according to a person familiar with the effort, who spoke on the condition of anonymity to describe it, transformed the fast-growing photo-sharing app. The integration helped bring new users to Instagram, boosting its audience to more than a billion people from 30 million at the time of the acquisition.

Before Facebook purchased Instagram, the start-up stored user data on cloud servers owned by Amazon and other companies, according to two of the people. As soon as Facebook bought the company, it offloaded Instagram’s user data onto Facebook’s custom servers.

Facebook also integrated the back-end technology to enable it to add its own features to Instagram, such as photo tagging. It further united the networks by enabling users to post Instagram Stories to their Facebook news feed. It now allows cross-posting in the other direction too, from Instagram to Facebook.

Today, the underlying technology between Instagram and Facebook is identical, the people said. They sit in the same servers and databases and share the same spam filters, and users share a single advertising profile. For example, if an Instagram user clicks on a makeup ad within Instagram, Facebook will tell advertisers to market beauty products to the same user when they are on Facebook. The creation of a single advertising profile has allowed the company to collect even more data about people’s behavior and gain an even more complete picture of people’s habits, fueling its advertising engine.

These integrations have hardly gone smoothly. They prompted so many conflicts that it pushed Instagram’s founders to suddenly quit the company in 2018, according to various reports. According to the FTC complaint, Zuckerberg worried that Instagram’s growing popularity was cannibalizing Facebook, and his move to merge the two products was an attempt to gain more control over Instagram’s direction.

WhatsApp has had a different trajectory than Instagram because its founders were able to keep a more distinct identity for the messaging service, in part because of its focus on encryption and privacy. Unlike Instagram, WhatsApp also was not a social network — even if it had some attributes of one. The fact that it was popular in markets outside of Facebook’s core base in North America and Europe made it less competitive.

Government scrutiny has also played a role. When the EU examined Facebook’s $19 billion WhatsApp acquisition in 2014, Facebook told antitrust regulators that it would not merge its data with Facebook. Two years later, Facebook announced it would do just that.

The announcement led the EU to relaunch an investigation of the merger, ultimately giving Facebook a minor fine of $122 million in 2017 for providing misleading information during the vetting of the merger.

WhatsApp engineers stopped a plan to combine WhatsApp user profiles with Facebook profiles, in what was internally dubbed the “EU Pause,” according to one of the people. Today, these profiles are still not combined into one database.

But WhatsApp runs on Facebook servers and infrastructure and uses tools, such as an anti-spam filter, that are built by Facebook.

But the effort to do so is underway, according to the people, a sign that Facebook will not be daunted by a government lawsuit that its lawyers estimate could take a decade to fight.

“Folks figured out how to break AT&T apart, which had a far more complicated physical network,” said Barry Lynn, antitrust scholar and director of the Open Markets Institute. He calls Facebooks’s claims about integration “spin.”

An earlier version of this article incorrectly stated the number of messages WhatsApp provides each day. The service provides 100 billion messages, not 1 billion.