What latency actually measures
Latency is the time a small message takes to reach a server and come back. It's measured in milliseconds, and it's mostly a matter of distance. Light in optical fibre covers about 200 kilometres every millisecond, so each 1,000 km of cable adds roughly 10 ms to a round trip before any detours.
Detours are the other half of the story. Traffic follows cables and peering agreements, not straight lines. A city 800 km away can answer slower than one twice as far if your provider's route takes the long way round, and a test like this one is how you find out.