I'm not a dev, so I hope I have this right:
Short answer: POS is the estimate of position from the best available estimation-filter. It is difficult to reproduce this estimate by-math, but possible.
Longer answer: The POS message gets data from the call: ahrs.get_position(). What exactly the "ahrs" is depends on the available amount of computation and version of the firmware. On a fully-capable hardware platform (PixHawk) it's the highest-complexity (read "best") estimation filter, unless that filter hits some math error, in which case it's second choice is the solution from a lower-complexity (simpler = not-as-good, but better than nothing!) estimation filter. I think with Plane 3.8 that NavEKF3 becomes the "best filter", but with Plane 3.7 and earlier NavEKF2 was the best.
The GPS measurement is one of the key (arguably THE most important) measurement that drives the filter's estimate. So the filter's estimate will largely agree with GPS, but should not be identical. If you want the "2nd" GPS used instead of the first always, you need to make it GPS1, and make the other one GPS2. Alternatively, you can use GPS_AUTO_SWITCH to have the estimation filter use whichever GPS has the best quality solution.
If you want to reproduce the POS message by-math in post-processing, you'd need to implement the same Kalman Filter on the same data at the same timing. I expect that would be hard, although not impossible.