Dear Student
Atoms being neutral means that the no. of protons and no. of electrons are equal in the given atom.
And an atom gain or loose electron to gain higher stability by completing its octet and getting its electronic configuration identical to the nearest noble gas which is the most stable known elements on the earth.
Eg: Na has 11 protons and 11 electrons in neutral state with electronic configuration 1s2 2s2 2p6 3sā1
but it looses 1 electron to have electronic configuration identical to Neon i.e. ā1s2 2s2 2p6