There is a short list of makeup products where the drugstore version is genuinely as good as the premium one, and primer is the clearest case on it. The mechanisms are simple, the ingredients are cheap, and the formulation challenge is modest — which means the difference between a four-dollar primer and a forty-dollar one is often packaging, feel and marketing rather than performance.
The specific place this is most true is grip. A tacky polymer film that gives foundation something to adhere to is not hard to make well, and the drugstore version of it is one of the most useful products in all of makeup for mature skin. If your complaint is that your foundation has gone by lunchtime, you can solve that for the price of a coffee, and no premium product solves it better.
Where money does buy something is blurring. Silicone-elastomer blends are where formulation skill shows, and the premium blurring primers do genuinely sit more comfortably and scatter light more evenly than the cheap ones. If texture rather than wear time is your complaint, that is the one place to consider spending.
The other thing worth paying for is high SPF built in — but read the SPF primer page first, because the honest position is that a thin cosmetic layer does not deliver its rating, and a cheap mineral base applied generously may protect you better than an expensive SPF 50 applied sparingly.
What you do not need to pay for at all: hydration. Glycerin and squalane cost almost nothing, and a drugstore moisturizer does the hydrating-primer job as well as a premium one. If hydration is your complaint, read primer versus moisturizer before buying either.