Keep in mind that Walmart is able to beat everyone in price not by having less of a markup but by purchasing in huge volumes to get a lower wholesale price to begin with. Off the top of my head our typical store margin is between 20-30%. So yes, pretty high. That doesn't tell the what the company actually pays I'm sure. But markup isn't where we make the money.
Most sales, and particularly BOGO are loss-leaders to get people to sign up for the loyalty card. That's where the money comes from because now we have your phone number and email address and purchase history to sell. Every one of those coupons that prints on the receipt is a paid advertisement. CVS gains by promoting those products. By gamifying coupon use. And those ExtraBuck coupons aren't discounts but more like short-term microloans that CVS keeps the interest on.