For these, reversing the polarity would reverse the direction of the train. Some locos had AC motors. These motors had one set of windings that make the motor go one way, and another set that makes it go the other way. A flip-flop relay was used to direct the power through one set of windings or the other. Pulsed power to the motor makes the loco start out slower and smoother.
Electronic momentum makes model trains act like real trains.
Memory allows hand-held throttles to be moved from plug to plug. The next advancement was command control. So, instead of controlling the voltage and polarity on the track to run the train, you actually control the train itself. The first of these command control systems used radio frequency signals to control the receiver - not in the wireless sense, but with radio frequency signals being sent through the track along with the DC voltage that runs the loco's motor. Later versions of this type system use an analog control signal superimposed on top of the DC voltage.