system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does Google/Apple Maps accurately measure traffic on every single road to predict trip time from origin to destination?

In addition to amount of traffic and trip time, how do they know if an accident occurs? I assume it has something to do with satellite imaging and/or tracking individual user’s location that are using the app on their phone.
gpt
There are quite a few sources of data. Crowd sourced information is very fast and high precision, but can be messy (is the traffic bad, or is this person just driving slow?). This kind of data comes from anonymized reporting while your phone is using its GPS. For example, while you’re using the turn by turn directions, you’re also reporting your own location data (anonymously) which gets combined with other people’s data and turned into one component of the traffic prediction.

Another source of data is simply highway patrol. Different states (and countries) have different methods for determining and reporting traffic on major routes, but they almost always have something. This data is very curated and accurate, but sometimes lags behind a bit and only covers major roads. Despite the lag, it can still be a valuable tool for training the predictive model to better understand the more variable patterns produced by the GPS data.

And finally of course you have accidents and construction, which are usually reported very quickly, again to highway patrol, and these usually have a comparatively predictable effect on traffic. They can’t be used to give high precision predictions on their own, but taken together with the rest of the data, they’re very valuable.