The fundamental rule for the attraction and repulsion of magnets is magnetic forces follow the inverse-square law. opposite charges attract each other and like charges repel. like poles repel each other; opposite poles attract. magnetic poles attract other magnetic poles.