When steam came to the woods just after the turn of the previous century the logging locomotives were the cutting edge of technology. They could move logs farther, faster and in much greater quantity than had been done with horse and oxen. Before the logging railroads the mills were small and often had to be moved, since the log supply had to be within reach of a team of oxen. The logging railroads allowed larger mills to be built because of the much larger area serviced by the railroads.
Often the Sierra mills had their own dedicated logging railroads that didn’t connect to any mainline. They would build spurs to logging areas. When the logging was done, they would tear out the spur and re-lay it into a new logging area. Steel was expensive so they reused all the hardware. Back then the mills were built in the woods to be close to the timber. It was more efficient to move the lumber from woods to the cities than it was to move the logs to the cities.
When the logging truck came onto the scene the loggers no longer needed to build rail spurs and instead built truck roads. This allowed quick access to areas that couldn’t be reached with a logging railroad. As a result mills could go farther to acquire logs, which resulted in mills being moved from the woods to the cities.