i know that 2 are like poles repel and opposite poles attract
Magnetic forces exist between magnetic materials. Unlike magnetic poles attract, while like poles repel. The strength of attraction or repulsion between two magnets is a function of distance between them.