Potassium (K) is in group 1 of the periodic table, therefore it has 1 electron in it's outer shell. Sulfur is in group 6 so it has 6 electrons in it's outer shell. Ionic bonds occur when electrons are transferred between atoms, resulting in ions of opposing charges and attraction between those ions. Both atoms of K transfer their outer electron to sulfur, and become positively charged. Sulfur, upon gaining these electrons, becomes doubly negatively charged, and these opposing charges results in the formation of the ionic bond. 2K --> 2K+ +2e-S + 2e- --> S2-