It is a long holdover from the railroad where you didn't have the same gauge of rail and would switch trains but be on the same ticket mostly for mountain climbing. The airlines picked it up for the same reason where a transcon or transoceanic flight would involve multiple aircraft of differing capabilities. At this time these legs were usually not sold independently of each other as the stop points were in the middle of nowhere. Now days it is just marketing and a way to move flights to show direct which is shown higher on many listings, and prior to 2001 the airlines didn't have to show that it was a change of gauge flight.