When two objects are rubbed together, one gains electrons and becomes negatively charged while the other loses electrons and becomes positively charged. This transfer of electrons creates an electric field between the charged objects. Electric fields are represented by electric field lines that are drawn from positive to negative charges, never cross, and are closer together where the field is stronger. Opposite charges attract while like charges repel each other according to the behavior of electric fields.