I see this question has already been answered, but here is what Wikipedia says:

Other exceptions to Madelung's rule:
For example, in the transition metals, the 4s orbital is of a higher energy than the $\ce{3d}$ orbitals; and in the lanthanides, the $\ce{6s}$ is higher than the $\ce{4f}$ and $\ce{5d}$.

I don't understand the reason behind this.

Shouldn't it be that the $\ce{4s}$ orbital is of a lower energy than the $\ce{3d}$ orbitals (that's why it is filled first) and in the lanthanides, the $\ce{6s}$ is lower than the $\ce{4f}$ and $\ce{5d}$?

It also states that in heavier elements the inner electrons move with a speed approaching the speed of light. So why don't we consider the great amount of kinetic energy associated with the electron? If we consider this energy then the inner orbitals should not be filled first owing to their great amount of energy?

There is a list of exceptions arising from electronic configurations of lanthanides and transition series.

The exceptions in the transition series are explained by the fact that half and fully filled orbitals are more stable (although my text doesn't state why they are stable)?

So similarly do we have a rule that governs the electronic configuration of lanthanides? I believe for someone who is in his first year Hartree-Fock calculations are not a good thing to start with. So do I need to just memorize them all?