A hydrating primer and a moisturizer contain largely the same things — water, humectants, emollients, silicones — and are sold as separate steps. That is not a scandal, but it is worth noticing, because on mature skin an unnecessary layer is not free: it is another film to crack along a crease and another container to open.
The real difference between the two is what each is formulated to do at the end. A moisturizer is designed to be absorbed: it delivers water and lipids into the surface and mostly disappears. A primer is designed to stay on top: it provides a surface for makeup to adhere to, or a film that scatters light, or a tacky layer that stops foundation moving. Those are jobs a moisturizer is not trying to do.
Which means the question is not 'are they the same'. It is 'does my foundation need something a moisturizer does not provide'. For a lot of people over 50 the answer is no, and the time and money is better spent on a foundation that suits them.
There is one strong case for both, and it is worth naming: dry skin with visible texture. A moisturizer handles the dryness and a blurring primer handles the texture, and neither does the other's job. In that case you want both, applied in the right order with a wait in between — which is also the layering sequence most likely to pill if you rush it.
The order never varies: moisturizer, wait, primer, wait, foundation. Primer under moisturizer makes no sense — the moisturizer would absorb through or disrupt the film — and no primer is formulated for it.