NEW YORK (The Street) -- You know CVS (CVS) - Get CVS Health Corporation Report: It's the place you go to buy everything from cold medicine to eye drops and hand sanitizer. But the drugstore giant's purchase ofOmnicare (OCR) on Thursday might have left you wondering exactly what a "pharmacy services provider" is, and why CVS would pay $12.7 billion for one.

The answer is simple: "CVS is a retail pharmacy where you can walk into the store," said Charles Rhyee, an analyst with Cowen in New York. "Omnicare is a specialized pharmacy that serves nursing homes and assisted living facilities."

The takeover is the latest this year involving pharmacy services companies, businesses related to prescription drugs that don't actually manufacture or sell them in a traditional bricks-and-mortar pharmacy. Two of the deals involved so-called pharmacy benefit managers, a bureaucratic name for a business most Americans use regularly.

Pharmacy benefit managers are the companies that administer the prescription-drug portions of health plans, according to the American Pharmacists Association. They develop the formulary that decides which medicines are covered and which aren't -- whether your plan covers the antidepressant Prozac, but not Paxil, for instance.

Pharmacy benefit managers also negotiate prices with drug manufacturers and process prescription-drug claims. If you pay out of pocket, they handle your reimbursement check. If you have a $10 co-pay at a pharmacy, they pay the pharmacy the difference between that and the amount your plan covers.

TheStreet Recommends

CVS moved into pharmacy benefit management in 2006 when it agreed to buy Caremark. Today, that business accounts for more than half of the company's $139.4 billion in annual sales. 

Buying Omnicare will let CVS Health expand significantly in the assisted-living market, which is expected to grow markedly with the aging of the baby boomers, one of the largest generations in U.S. history with an estimated population of 77 million. Cincinnati-based Omnicare dispensed about 111 million prescriptions last year, largely to senior citizens, according to its annual filing with the Securities and Exchange Commission.

"If you're CVS, you are interested in Omnicare for a number of reasons," Rhyee said. Growing larger lets CVS deepen volume discounts on its purchases, while adding an older customer base helps make up for the loss of Medicare-age shoppers when they become unable to walk into the chain's retail stores because of their declining health.

"With the population aging, more people are projected to use assisted-living facilities and independent-living communities in the coming decades, creating a substantial growth opportunity for us," CVS CEO Larry Menlo said on a conference call with investors and analysts.

There's another, smaller benefit, too. About a fourth of Omnicare's business comes from its rapidly growing specialty division, which delivers high-cost prescriptions for diseases such as cancer, rheumatoid arthritis and multiple sclerosis that are unavailable at traditional retailers.

In the end, the deal "comes down to size and scale," said Jason Gurda, an equity analyst with Keybanc Capital Markets. "There always will be a lot of pressure to get larger, have more leverage, and become more efficient. It's a competitive market and you cant afford to stand still."