Anthem would not be the first insurer to forgo external pharmacy benefits management and take on the role internally. The insurer UnitedHealth Group also runs a leading pharmacy benefit management business, OptumRx. And CVS’s purchase of Aetna would also remove it as a middleman acting between that insurer and drug companies.

“While it’s still early, the moves by Anthem and Aetna have the feeling of the beginning of the end of the stand-alone pharmacy benefits manager business,” said Craig Garthwaite, a health economist with Northwestern University’s Kellogg School of Management. These insurers, and UnitedHealth Group, have concluded that outsourcing pharmacy benefits management may not serve their interests.

This removal of profit-taking middlemen could be good for consumers in the short run if it leads to lower drug prices. “In the long run, it might be harder for new insurers to enter the market because they won’t be able to negotiate lower drug prices than the larger firms,” Mr. Garthwaite said. “This could result in further concentration in the health insurance market.” That could harm future consumers, though not in ways we can predict today.

The CVS-Aetna deal would be just another of the many recent mergers across business lines in health care. Insurers are buying or partnering with health care providers. Health systems are offering insurance. Hospitals are employing physicians. Even Amazon is jumping into the pharmacy business in some states. This may be part of the motivation for CVS to buy Aetna — defensive jockeying to maintain access to a large customer base that might otherwise begin to fill drug prescriptions online.

Typically, mergers in the sector have led to higher prices and no better outcomes. But a CVS-Aetna merger might be different because their business lines complement each other. The most significant overlap is in the management of Medicare drug benefits: Both companies offer stand-alone Medicare prescription drug plans.

But there is a lot of competition in the Medicare drug plan market, so this overlap may not be a leading area of concern.

The CVS-Aetna merger is primarily about a supplier and its customer joining forces, what economists call a vertical merger. This type of merger can enhance a firm’s ability to coordinate across interlocking lines of business.