Magnets are items that have the ability to pull or attract certain metals, such as steel and iron. There are north and south poles on every magnet.
Any magnetic material's atoms include electrons that primarily spin in one direction around the nucleus. The magnet develops a more positive side and a more negative side as a result. Thus, the magnet's north and south poles are created.
A magnetic field is produced around the magnet as a result of the difference between the high attraction on one side of the magnet where the electrons are spinning and the low attraction on the other side, where the electrons are not spinning.
All of the electrons begin spinning in the same direction when we combine the north and south poles of two distinct magnets. Strong attraction results from this.
On the other hand, electrons are likely to spin in the opposite direction when we connect the north pole to the north pole or the south pole to the south pole. This causes repulsion.