In K2O, potassium (K) is a metal, and oxygen (O) is a non-metal. When these two elements combine, potassium loses one valence electron to oxygen, resulting in the formation of K+ and O2- ions. These oppositely charged ions then attract each other to form an ionic bond. The electrostatic force of attraction between K+ and O2- ions holds the compound together.