How do iPads detect when a cover closes? Some iPad cases (particularly those that look like book covers) provide a feature that when the cover closes the iPad enters suspended mode and when the cover opens the iPad wakes up. The one provided by the link claims it provides this functionality through a magnetic strip. Does this mean iPads have the ability to sense nearby magnetic fields built in? Why and how does this work?

PS. It appears Apple's Smart Covers provide this functionality too.
The Smart Cover has a magnet that interacts with the sleep sensor of an iPad. So whenever you close the Smart Cover, iPad will know when to sleep. The same theory for waking up.

Info from MacRumors