Great question. It's a combination of gps data[1] and a lot of manual work. Mapbox for one has strong data teams running mapping initiatives[2].
[1] https://blog.openstreetmap.org/2013/04/12/bulk-gpx-track-dat... [2] https://github.com/mapbox/mapping/wiki