It takes energy to move an electron up from
its normal resting energy level to a higher
energy level (absorption). This is because you are moving
the negatively-charged electron away from
the positively-charged nucleus.
(Analogy: it takes energy to pull two
attracted magnets apart.)
Freedman and Kaufmann
Likewise, when an electron moves from a higher
energy level back down to a lower energy
level, it releases energy (emission).