Magnetic turbo trainers are very popular because they allow the rider to select various resistance levels, thus the rider can choose to have a low power warm-up session or they can ramp up the resistance and have a hard thigh burning workout (i.e. like riding up a steep hill).
Mag trainers, as they are often referred to, work by spinning a magnetic disc (or two discs) relative to a stationary metal plate (or vice versa). This creates what are known as 'Eddy Currents', which in-turn cause a drag on the metal disc (i.e. what makes it harder to spin your pedals). The way you can increase or decrease the resistance of the mag trainer is by moving the magnets closer or further away from the metal disc, because the closer the magnetic disc is to the metal disc the higher the drag/resistance. One issue is that the system heats up and therefore most mag trainers use an additional fan to help cool things down. This can generate a fair amount of noise, so mag trainers can be quiet noisy.
More expensive turbo trainers use an electromagnetic resistance unit to basically do the same thing. However, instead of having a magnetic disc (which may well be a metal disc with lots of magnets embedded in it), an electromagnet uses electricity to generate magnetic fields that cause the drag on the spinning metal disc. While the principle is the same instead of moving the magnets closer to the spinning metal disc the strength of the magnetic field is increased instead increasing the current. Read more about electromagnetic resistance turbo trainers and browse different models here.