I think the question was "how did the phone company know the location", and GPS may be part of the answer.
In the US, E911 requires all phones to be able to report their physical location. Phone companies may use this ability to respond to police location requests. I don't know one way or another, but it seems likely.
Even if they don’t, they can use trilateration/triangulation (for which I assume they always have the necessary information: signal strength and approximate distance) to pinpoint the exact location.
They won't use that if the GPS / "Location" service is turned off. But the cell network still knows where you are anyway, within ten meters or better. The FCC asks for z-axis accuracy within 3 meters; good enough to determine what floor of a building you're on (for E911 purposes.) 5G Rel 17 can supposedly locate people within a meter.