Positive and Negative Charges
There are two types of electrical charges: positive and negative. These charges depend on the number of protons, or positively-charged particles, that an atom has in relation to the number of electrons, or negatively-charged particles. Most of the time, these are equal. The protons are grouped together in the nucleus of an atom, and cannot be separated except by nuclear fission. In fact, if the number of protons were to change, the atom would become a different element. Electrical charges of materials depend entirely on the movement of electrons because of their relative freedom.
Arrangement of Electrons
In the early 20th century, electrons were thought to orbit the nucleus of an atom similar to the way the planets of the solar system orbit the sun. This is only partially true. Electrons travel in shells around the nucleus; they move so quickly and unpredictably that their exact position and velocity is impossible to determine with current technology. Each electron shell holds a set number of electrons: starting from the initial shell, there are two electrons, then eight, then eighteen.
Movement
Only the valence shell, or the outermost shell of electrons can interact with other atoms due to the mutual electromagnetic repulsion of charged particles. Atoms attempt to have a full valence shell whenever possible; if they have few electrons in the outer shell, these electrons will move to an atom that lacks electrons. For example, if you have an atom with one electron in its outer shell, that one electron can move to an atom with one slot free and will do so if the opportunity becomes available.
Causes of Electron Motion
Heat causes atoms to move more quickly and interact with one another more often, giving electrons chances to rub off and thereby turn atoms into charged particles. Exposing the atoms to an electric field, such as from a power supply or a magnetic field, causes electrons to either attract or repel from the new object depending on whether the field has positive or negative charge. Like charges repel and opposite charges attract.