From a page at Quora:
The phone uses three methods to determine your location, depending on what it can access at any time. First, it uses a GPS that triangulates to satellites in the sky to determine your location within a few feet. But you must have a reasonably unobstructed view of the sky. Second, if you are not in airplane mode, and can reach a cell tower, the phone triangulates to available cell phones towers and estimates where you are based on the signal strength of the various towers it can reach. This is the least accurate method, but it covers a lot of ground and can be surprisingly good. Third, and finally, if your phone can pick up on wi-fi signals from local homes and businesses. these have been cataloged to allow Apple to tell about where you are, even if the wi-fi signal is encrypted. (I THINK this still works, but I’m less sure.)
Some combination of these can nail your location very accurately most of the time.
But sometimes my phone still thinks I’m maybe a mile from where I am, usually if I’m in a building and my wi-fi is turned off.
From a Support Page at Apple:
With your permission, Location Services allows apps and websites (including Maps, Camera, Weather, and other apps) to use information from cellular, Wi-Fi, Global Positioning System (GPS) networks, and Bluetooth to determine your approximate location.
Apps that can show your location on the screen, including Maps, show your current (approximate) location using a blue marker. In Maps, if your location can’t be determined precisely, you’ll see a blue circle around the marker. The size of the circle shows how precisely your location can be determined—the smaller the circle, the greater the precision. When Location Services is active, a black or white arrow icon appears in the status bar.
In conclusion, the best way to make sure Location Services is finding you in the correct location is to have a clear, unblocked connection to GPS satellites, which isn't always possible.