When the transcontinental railroad was built, the government gave the railroads every other square mile within 10 miles of the tracks. it was a way to encourage the companies to make the investment and cost the government little. Later it was expanded to 20 miles in some places. The railroads sold some of the ground. There are still railroad-owned parcels you can buy pretty cheap, depending on location. Thus, you get alternating government land with private land, in a checkerboard pattern.
Jim