They can use a combination of triangulation, GPS, barometric pressure and wifi networks that your phone sees...
Are you sure?
And 5G points a beam at each phone, and measures a distance so it can tune signal strength.
here, you see examples with 2 beams, but 5G can direct up to 50,000 of them from an array, each beam with left/right/up/down precision. Each beam is tuned to have a certain power level at a certain distance, so it calculates the distance based upon delay as well. It knows where your phone is within a few cm whenever it establishes a call, and within a few meters generally. When you move to another cell, there is no drop, because that exact location is passed on to the other cell, and that cell establishes a beam to the same point.