Actually, it's a puzzle for grad students studying quantum field theory. Why do like charges repel and unlike attract? They both interact through exchange of a photon. So how can bouncing photons back and forth cause attraction in one case and repulsion in the other?
Think about two guys, each sitting in a row boat, and the boats are sitting on a lake. If they throw a baseball back and forth, it will cause them to get farther apart. Each will have to push the ball in the direction of the other, so getting a back reaction. And each will catch the ball coming from the other, again causing a back reaction. So the naïve expectation from normal experience is, tossing photons back and forth should cause repulsion.
The answer is actually pretty tricky, and arises in the fact that the electric field is a quantum field of virtual particles.