there are a few types, and as unbelievable as it may be they are called trainers.
magnetic resistance type or mag trainer has a couple of magnets, one fixed and one move-able, the bike is propped by the back axle and the turning surface adjusts to the wheel. as you pedal the wheel turns the revolving magnet, and this causes resistance as the like poles pass each other. Mine has three resistance settings, which basically works by bringing more or less of the magnet into line with the other.
wind trainer basically blows air to gain resistance and a fluid trainer passes fluid through a variable restriction
Hope this helps!!