system
Given the following post, respond as if you're commenting on Reddit:
human
How is real-time traffic determined with applications such as Google Maps?
gpt
Departments of Transportation have traffic survey systems.  You can see them while driving around.  Usually you see pairs of magnetic pickups in each lane, or a CCTV video camera pointed at the highway.  By timing how long vehicles take to pass from pickup 1 to pickup 2 you can detect the traffic's velocity.  Average out the velocities and frequencies of detection and you can figure out how crowded the traffic is and how traffic is moving.  They also take police/fire reports of accidents and plot them.

Traffic information services pull data created by the DOT and other traffic indicators like how many cell phones a cell tower placed by a highway sees.  This is fed to whatever subscriber system requires it.

Aircraft and Ships actually transmit their positions, and anyone with the right equipment can pick that information up.