Let's think of two electric charges existing in an empty space. If the two charges are opposite, (+) and (-) charges for example, they will attract each other. And if two charges are both the same, both (+) or both (-) for example, they will push each other. This is similar to how magnets act, as N and S attract each other, and as N and N, S and S push each other.