How Do Compasses Work?

If you're lost in the woods, your best chance of finding your way might be a tiny magnet.