why does like poles of the magnet repels each other
Hi Sumaid!
Around a magnet, there exist magnetic lines of force. The lines of force are originating from the North Pole and terminating at the South Pole of the magnet. When two magnets are brought close to each other, the flux lines from both magnets interact. If these flux lines are flowing in the same direction, they will link up and the magnets will attract each other. If they are flowing in opposite directions, they will produce a repulsive force and push away from each other.
Cheers!!