Great question. Albert Einstein proved that light acts as both a particle and a wave in his 1905 paper. This is called wave-particle duality.
With quantum mechanics, it is easy to prove that light behaves as both a particle and a wave.
When UV light hits a metal surface, it causes an emission of electrons. This "photoelectric effect" proves how light behaves.
Ionic compounds is your answer. What happens is one atom donates electron(s) to the other atom, making one positive and the other negative. The opposite atoms attract, forming an ionic bond.
Hope this helps! :)