Allegedly, Apple have built in privacy features so they can't associate individual users with routes, or know what the entire route is[1]. Apple does show traffic data in the app, so they obviously do collect the data somehow.

When Apple built maps, the car project was still alive, so it would have been a factor in deciding on the investment. They could still partner with a car manufacturer and use the data.

I do suspect that my first point was key in green lighting Apple Maps. Google could have asked for more and more money to provide maps for Apple, or they could pull out completely, and force users to use the App Store app, which would have left the product direction of Maps completely out of Apple's hands.

[1] https://www.idownloadblog.com/2019/03/13/apple-maps-navigati...

I haven't been an employee since 2015, but by then Google had already been doing the route trimming and splicing for live traffic data. (If you had location history enabled, some of that same data at lower granularity was stored in another service, of course)