What causes an electron to move from lower energy level to higher energy level

Matter can gain or lose energy in small, specific amounts called quanta. A quantum is the minimum amount of energy that can be gained or lost by an atom. For example, it might seem that you can add any amount of heat to water, but what is actually happening is that the water molecules absorb quanta of energy which increases the water's temperature in infinitesimal steps. Because these steps are so small, the temperature seems to rise in a continuous, rather than a stepwise manner.

Now, what does this have to do with energy levels and electrons? Well, the reason why matter can gain or lose energy only is small, specific amounts is because of the energy levels in the atoms. Presented by the equation here created by Planck: Quantum E = hv, (h is Plank's constant and v is the frequency) for a given frequency, matter can emit or absorb energy in whole number multiples, like legos. You can only take or add a whole lego, not a part of it. Therefore, quantities of energy between the whole number multiples do not exist, meaning there are fixed energy levels in an atom with quantized energy (because energy is absorbed through electrons in energy levels) and electrons can only exist within the energy levels, not between them. Each energy level has a higher quantized energy than the previous. So, to answer your question, when an electron absorbs energy (a specific amount of energy), the electrons moves up to higher energy levels because the electron has a higher quantized energy than its own energy level. Similarly, when the electron releases energy (a specific amount of energy), the electrons moves down to its original energy level because it has lost the absorbed energy and has the same quantized energy as its own energy level.

Hope I answered your question!