Toy trains were revolutionized when Märklin, a German company that specialized in doll house accessories, sought to make an equal toy for boys where a continuous revenue stream could be ensured by purchasing add-on accessories for years after the first purchase. Along with boxed sets comprising a train and monitor, Märklin offered extra track, rolling stock, and buildings sold separately, creating the predecessor to the modern model train layout featuring buildings and scenery in addition to a working train.
Electric trains followed, with the first appearing in 1897, made by the U.S. firm Carlisle & Finch. As residential use of electricity became more common in the early 20th century, electric trains gained popularity and as time moved on, these electrical trains grew in sophistication, gaining light, the ability to change direction, to emit a whistling noise, to smoke, to remotely couple and uncouple cars as well as load and unload cargo. Toy trains by the first half of the 20th century were frequently made of lithographed tin; later trains were frequently made mostly of plastic.
Prior to the 1950s, there was little differentiation between toy trains and model railroads–model railroads were toys by definition. Pull toys and wind-up trains were marketed by kids, while electric trains were marketed towards teens, particularly teenaged boys. It was during the 1950s that the modern emphasis on realism in model railroading began to grab on.
Now, S gauge and O gauge railroads continue to be considered toy trains by their own adherents and are often accessorized with semi-scale model buildings by Plasticville or K-Line (who owns the rights to the Plasticville-like buildings produced by Marx in the 1950s into the 1970s). However, as a result of their high price, one is more inclined to find an HO scale or N scale train set in a toy shop than an O scale set.