This article is from the Model Trains FAQ, by Christopher D Coleman with numerous contributions by others.
Lionel switches equipped with the non derailing feature (three
rail) have an insulated rail at the end of each track on the
split end of the switch. The switch operates by means of two
electromagnetic coils wired oppositely, surrounding a
plunger. The plunger is mechanically connected to the moving
mechanism of the switch. One coil supply is permanently connected
to the center power rail, except in the #022 O gauge switch where
a constant power plug can replace it. The other supply of each
coil is connected to the controller where either can be connected
trough the third wire to ground to energize that coil and move
the plunger in that direction. In non-derailing the insulated
rails are also connected to the appropriate coil to clear trains
coming from that direction. When the train axles bridges that
rail to the ground rail, the switch will move to pass it
automatically and thus avoid derailments in an open switch. Since
the insulated rail is at the end of the switch, an insulated
track pin is needed to prevent a permanent connection to
ground. The length of the insulated can be increased by
connecting an insulated rail track to the switch insulated
rail. One problem is that when power is supplied and a train is
stopped on the switch, the coil will remain energized as long as
the rail is bridged. The #022 switch avoids this with a series of
contacts inside that deactivate the coil when it is already in
the proper direction.
 
Continue to: