Why is a nail attracted to either pole of a magnet, but another magnet is attracted to only one of the poles?