The attraction keeps the electrons from flying away from the nucleus. Electrons are a part of the nucleus. They are negatively charged atoms.
Their mass is 1/1836 of what a proton's mass would be. Opposite of electrons, protons are positively charged. They are also found in the cell nucleus. As the saying goes, opposites attract, and that is the same when it comes to electrons and protons.
When they come in close contact with each other, they attract each other. If they didn't attract to each other, they would move away from each other when in contact.
Electrons are found in the cell nucleus. They have a negative charge and they have a mass of 1/1836 of at the proton. The protons have a positive charge and are also found in the cell. When electrons and protons come close, they are attracted to each other. If they were not, then the electrons would move away from the nucleus.
Each nucleus needs the appropriate amounts of electrons that are needed in the atom to make it what it is supposed to be. If the electrons flew away, the atom would not be what it is supposed to be. Therefore, keeping the electrons in the nucleus by making the protons attracting them will make the atom stay the same.