There is a fundamental misconception about the law of 'like attracts like,' and that is the scientific notion of 'opposites attract.' But the idea of opposites attracting is a matter of nomenclature more than a fundamental principle.
For instance, consider this simple experiment:
Charged spheres attraction demonstration
• When the two spheres are connected to different poles of the battery, they attract.
• When the two spheres are connected to the same pole of the battery, they repel.
Take two spheres of very light weight, each coated with a thin film of metal. The spheres are suspended near each other by fine metal threads in a closed glass box to exclude air drafts. Each suspending thread is connected to a brass terminal. Next to the box is a battery with two terminals. When both spheres are hooked up to different poles of the battery, the spheres come together, and when they hooked up to the same terminal, they move apart. The explanation assigned to this experiment is that (1) there are two and only two types of charge, and (2) opposite charges attract. This convention has been adopted, reasonably, for over 100 years.
However, it contradicts another well-known fact of science: that energy is isotropic (the same everywhere). In other words, the energy that composes a proton is the same as the energy in an electron, or the energy in any sub-atomic particle, or the energy in any force carrying particle like a graviton.
In discussing the difference between iron and copper, for example, we do not postulate a "copper energy" and a separate "iron energy." The difference is entirely geometric. What makes the two elements unique lies in the arrangement of the particles, all of which are composed of the same energy. My understanding is that "charge" is also explained in this manner: a charged particle is only charged because it has, in its geometric arrangement, a dearth or a surplus of electrons. So the assignment of "positive" and "negative" is convenient, but arbitrary. Electrons are assigned a negative charge, and protons a positive charge, but if energy is fundamentally isotropic then there is really no such thing as "positive" and "negative" charge or energy, even though it helps us to think in this way.
In a battery, the positive pole has a dearth of electrons and the negative pole has a surplus of electrons. The electrons try to find balance by going from one pole to the other. In other words, the electrons at the negative pole want to party with their friends at the positive pole, and the electrons at the positive pole desire their mates to join them. When the system finds balance, the battery is no longer charged.
In a magnetic field, the north pole and the south pole attract, whereas similar poles seem to repel. But a closer look dispels this notion.
The magnetic field created by an electromagnet, for example, is composed of photons. Like the battery, BOTH poles of the magnet are composed of the same force-carrying particle of electromagnetism. The south pole attracts the north pole because the geometry of the fields are compatible, but both poles are composed of photons. Again, it is the underlying concept of 'like attracts like' at work.
In life this notion of opposites attracting may also seem to have validity, as an outgoing woman might prefer a more reserved man, or vice-versa. But when you get to know the couple better you will see a powerful congruence in one or more fundamental personality characteristics. it is these fundamental likenesses that keep the relationship going, despite more superficial opposites.