Electrons are stable elementary particles. They do not decay.
A quantum mechanical solution for the potential between an electron and a proton, forming a hydrogen atom,for example, gives energy levels which can be occupied by an electron. These energy levels have a width which is due to the probability of an electron transition from a higher energy level to a lower one.
It is the whole atom that transitions from one state to a lower energy state
This is the Bohr model solution for the hydrogen atom. The orbits in the quantum mechanical solution are orbitals, probability loci.
So if an electron is captured at one of the high n (energy )levels, it will emit during capture the appropriate energy photon and then there can be a cascade of transitions of photons ending up in the ground state. This will give the emission spectrum of the hydrogen atom.
Once the hydrogen atom has the electron in the ground state it will remain there unless an interaction with a photon happens.
But what is the reason for attaining the higher and unstable energy states by the electrons? Are there any specific factors for this event to take place?
The atom can only be excited by a photon providing the appropriate energy between energy levels. That is the appropriate factor.
The absorption and emission spectra show the widths of the photon energies that can excite the atom.