The US census records home and workplace locations. The game generates millions of commuters with homes from that and then uses a distance-based gravity model to assign them all workplaces. They're also assigned times to leave to/from work in a distribution similar to real life.
This decision is then made based on how long each commute method takes, how much it costs, and the value of their time (different commuters can have different incomes).
If they decide to take the subway you can follow their commute (and thousands of others simultaneously) as they get to work. If a train is delayed or cancelled, it will affect their commute and future commuters will take that into account.
College and airport commuters are also simulated and they behave differently since they have different income distributions and commuting times. Federal data is used for college student counts and FAA data for airports.