Here's why:
* Potassium (K) is a metal in Group 1 of the periodic table. It has one valence electron, which it readily loses to achieve a stable electron configuration.
* Bromine (Br) is a nonmetal in Group 17. It has seven valence electrons and needs one more to achieve a stable electron configuration.
When potassium and bromine react, potassium loses its valence electron, forming a positively charged potassium ion (K+). Bromine gains this electron, forming a negatively charged bromide ion (Br-). These oppositely charged ions attract each other electrostatically, forming an ionic bond. This ionic bond results in the formation of potassium bromide (KBr), a white crystalline solid.