Quite surprised by the question, it would be great if you provided examples. From personal experience, I can conclude that goods related to the traditional assortment of pharmacies (condoms, pregnancy tests, ascorbic acid, hematogen) in supermarkets are just more expensive than in pharmacies. It comes to the paradoxical: in the center of the hall of the Spar hypermarket there is a branded Spar-pharmacy, in which a large package of condoms (12 pcs) costs 200 rubles less than at the checkout of the same hypermarket. And it’s quite a logical rationale: most people are too lazy to waste time, make efforts to go to specialized stores and they are ready to overpay a little for the convenience of buying everything at once.
A pharmacy needs to earn money, since many drugs are included in the list of vital and essential drugs and their prices are regulated by the state. To make a profit, pharmacies sell everything with a wild markup, something that is not included in the list of vital drugs. These are condoms, cosmetics, toothpastes, dietary supplements, etc.