Atom loses electron when it absorbs enough energy to counter the electrostatic attraction between the nucleus of the electron and the electron in question! Remember that energy is the ability to do work. Mathematically, work is force x displacement. So, an atom must have energy, and then atom must absorb that energy. Atoms can do work by knocking out electrons.