Why are fridge doors magnetic? Why do fridge magnets stick to fridges? What purpose does a magnet have in a fridge? Why do the magnets stick so well to the fridge doors but not so well to keys or nails? 
 A: (a) "Why do fridge magnets stick to fridges?" The poles of a fridge magnet are spread out across the broad faces of the magnet. When placed on a fridge door the magnet temporarily magnetises the steel of the 'patch' of door with which it is in contact (so-called $induced$ magnetisation). [There is partial alignment of magnetic domains within the steel, making the outer surface act as a South Pole if the magnet's North Pole face is in the one in contact with it.] 
(b) "What purpose does a magnet have in a fridge?" I don't quite know what you have in mind. Some fridges have magnetic material in the rubbery strips on the inside edge of their doors, making the doors stick to the body of the fridge when the doors are closed, helping to create a good seal.
(c) "Why do the magnets stick so well to the fridge doors but not so well to keys or nails?" Because the area of contact between keys or nails and the flat fridge magnet is much smaller than that between the fridge magnet and fridge door. Where the surfaces touch (separated by a film of paint) the attraction between the poles of the magnet and the induced poles in the metal is strong. Not much area of touch between fridge magnet and keys or nails!
A: Magnets stick to fridges because fridges are made of steel and steel is ferromagnetic.  You may have noticed that magnets will not stick to some stainless steel fridges.  Some stainless steel is ferromagnetic and some isn't.   This brief Scientific American article has some details.
Refrigerator doors typically have a magnetic seal or gasket around the edge of door that does the job of holding the door closed and forming an air tight seal.  Older fridges used a mechanical clasp on the outside of the door which was effective but resulted in more of a safety hazard because, unlike the magnetic seal, it was impossible to open from the inside.  This contributed in the suffocation deaths of some children playing in abandoned refrigerators.
Fridge magnets (the ones designed to stick on the outside of the doors) are often not attracted to keys because keys are typically made of brass, which is not ferromagnetic.  You may find the magnet is only attracted to the steel key ring.  They should be attracted to nails though, as Philip Wood pointed out is his answer, geometry plays a role here.  Fridge magnets are usually flat and designed to stick most effectively to a flat steel surface.
