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

The phenomenon you are referring to is called magnetic attraction. To understand why a nail is attracted to either pole of a magnet while another magnet is attracted to only one of the poles, we need to consider the concept of magnetic fields.

A magnet has two poles, known as the north pole and the south pole. These poles create magnetic fields around them, which are invisible but have a physical influence on nearby magnetic objects. The magnetic field lines of a magnet extend from the north pole to the south pole.

When a nail comes close to a magnet, it becomes magnetized to some extent by the magnetic field of the magnet. This is known as induction. The induced magnetism results in the nail acquiring its own north and south poles. Since opposite poles attract each other, the nail is attracted to either pole of the magnet. The strength of the attraction can vary depending on the properties of the magnet and the nail.

On the other hand, when two magnets interact, they exhibit a behavior called magnetic polarity. Like poles, such as north and north or south and south, repel each other, while unlike poles, such as north and south, attract each other. This is because the magnetic fields produced by the magnets interact. So, one magnet would be attracted to the opposite pole of the other magnet but repelled by the like pole.

In summary, a nail is attracted to either pole of a magnet because it becomes magnetized by the magnet's magnetic field and exhibits induced magnetism. Another magnet, however, is attracted to only one of the poles and repelled by the other because of the magnetic polarity interaction between the two magnets.