Railroads, as private companies, needed to engage in profitable projects. So the federal government passed the Pacific Railroad Act that provided land grants to railroads. This provided public lands to railroad companies in exchange for building tracks in specific locations.