Outside of the Eastern part of the US, the railroad land grant programs were a major part.
https://en.wikipedia.org/wiki/Railroad_land_grants_in_the_Un...
This is a part of why there were so many tiny little towns out West which were essentially just a railroad stop and a few buildings.