A Steel spikes in wooden crossties are the most obvious way railroads keep rails in place in North America. They are one piece of a system of components that has been evolving since the 19th century. The system includes spikes, tie plates, crossties, track anchors, bolts, rock ballast, and other components. The pieces are installed so that gravity naturally holds rails in the best position and that the weight of a passing train is distributed as evenly as possible without pushing the rails outward.
Together, the manufactured elements hold the rails at the appropriate distance, or in gauge; and they prevent rails from creeping or moving longitudinally in the direction of train travel. Railroads install a redundant number of spikes, crossties, and tie plates in new track so that failure of any one piece should not affect the function of the whole track to support a train’s weight. Railroad-employed track inspectors routinely check loose or missing spikes to see if they indicate a track failure or serious safety issue. – Steve Sweeney