The first is called lifetime broadening.  As you know, quantum mechanics tells us that the electron wavefunction is oscillating at frequency $\nu = E / h$, where energy $E$ is determined by the state that the electron occupies.  As we discussed in the context of light, a wave can only be truly single-frequency if it oscillates for all time.  An electron in an energy state has a finite lifetime in that state; eventually it will move to another state, by spontaneous processes or otherwise.  Therefore, each state has a finite lifetime, sometimes labelled $\tau$.  The finite duration of the wavefunction’s oscillation necessarily introduces additional frequency (energy) components to the electron’s wavefunction, thus broadening its spectrum.  This form of broadening can’t be avoided, but it also produces very narrow broadening in practice, as many states have very long lifetimes compared to their oscillation frequency.