when two magnetic pole have different charges and have a distance that is enough to interact with each other it attracts. On the other hand, when two magnetic pole have same charges and have a distance that is enough to interact with each other it repels.