Once upon a time, all electric model trains had a motor powered by direct current (DC) fed into the track rails. Increase the voltage and the trains goes faster. This approach can get quite complex when you want to control several trains at once - the more trains, the trickier the challenge. Also, lights were powered from the same source so increasing the voltage not only made the train go faster, it made the lights brighter.
Then the world was conquered by digital electronics and model trains were no exception. While traditional DC is still very common, the alternative is Digital Command Control (DCC) with uses fixed voltage alternating current fed to the track rails, with locomotives feeding that power to a magical black box of digital electronics, called a DCC decoder, which in turn passes independent DC power to the motor, lights and potentially anything else on board. Digital instructions are embedded into the AC power source, with the decoder translating these instructions into DC voltage passed to the motor or other component. Each locomotive is given a different identity so instructions such as lights on/off, speed faster or slower can be targeted to individual locomotives.
However, DCC is becoming more common as decoders get smaller and donor locomotives get more DCC friendly. There are basically two types of decoder. Modern model locomotives are more often a split chassis style, with power feeding up the sides of the chassis to a digital circuit board at the top which passes voltage to lights and the motor. For these, it is usually a simple matter of replacing the circuit board with one that incorporates a DCC decoder. An example of this type is the bottom decoder in the picture, suitable for an Atlas SD7 or similar.
Other locomotives pass power through wires or body parts from the rail pickup to the motor or lights. For these, you must use a decoder that has wires coming out of it and break the electrical connections between rail and motor and attach the decoder wires into the break. LifeLike SD7 is an example of this type with a couple of sutiable Digitrax decoders shown in the photo.
There are several brands of decoders that all follow the DCC standard so are interchangable. You don't have to stick with one brand or with the same brand as your DCC controller. Recent experiences fitting decoders is making me think Digitrax decoders are not the best. Visit Wiring for DCC and Marcus’ DCC for Dummies for everything you may want to know (and everything you don't want to know) about DCC.