One pole is a north-seeking pole. The other is a south-seeking pole. When magnets are placed together, they react according to the poles that are placed together. Opposite poles will attract and like poles will repel. A magnet's strength is greater at its poles and weaker in the middle.
Magnets are capable of attracting through all non-magnetic material.
The earth itself is a magnet. The compass acts like it does because the earth has a magnetic north pole and a magnetic south pole. It is possible to magnetize and demagnetize material. Sizes, shapes, and strengths of magnets can vary greatly. Magnets can be as small as the eye of a needle, or as large as a car.