Here's my take on why this happens.
!! LONG ANSWER !!
As it turns out, that assumption is an oversimplification that holds for lower-period elements, but starts to become shaky starting with the fourth period.
The basic idea behind the Aufbau principle is that lower-energy orbitals will be filled first. More often than not, the 3d-orbitals are being depicted as being higher in energy than the 4s-orbital - here is where the problem with chromium's electron configuration is.
A neutral chromium atom has a total of 24 electrons surrounding its nucleus. If we were to follow the Aufbau principle and write the electron configuration of chromium, we would end up with (I'll use the noble gas shorthand notation)
#"Cr": ["Ar"] 4s^2 3d^4#
The logic here is that you fill the lower-energy 4s-orbital first, then move up to the higher-energy 3d-orbitals.
However, that is not what actually happens. Once you get to the transition metals, you need to take into account two important aspects
- the energy gap between 3d and 4s orbitals;
- the repulsion that exists between electrons.
Promotional energy is the energy needed to promote an electron from a lower energy orbital to a higher energy orbital. Simply put, an energy price must be paid when electrons are being promoted to higher-energy orbitals.
This means that an energetic benefit should come from promoting an electron to a higher energy orbital, or else there's really no point in promoting it.
This is where things get a little messy. As you get to the transition metals, the 3d-orbitals are actually a little lower in energy than the 4s-orbital.
However, that is the case for empty orbitals. Once you start adding electrons you need to take into account repulsion. As you move across the fourth period, the effective nuclear charge increases, which will influence on the energy levels of the orbitals and the gap between the 3d-orbitals and 4s-orbital.
So here's what I think actually happens when chromium fills its orbitals with electrons. You start by having the 3d-orbitals lower in energy than the 4s-orbital, so the first electron goes there
#"Cr"^(5+): ["Ar"] 3d^1#
After one electron occupies a 3d-orbital, the 3d-orbitals are still lower in energy than the 4s-orbital. The same is true for the next 4 electrons
#"Cr"^(+): ["Ar"] 3d^5#
Keep in mind that once you add more than one electron to the 3d-orbitals, repulsion will start to increase the energy of some of these orbitals to a level even closer to that of the 4s-orbital, which is still empty at this point.
Now comes the interesting part. Before this point, the promotional energy needed to promote an electron from the 3d-orbitals to the 4s-orbital was not wroth the reduction in energy you'd gain from reducing repulsion.
At this point, that changes. Now it is energetically favorable for one electron to be promoted from the 3d-orbitals to the 4s-orbital in order to reduce repulsion, so instead of
#"Cr": ["Ar"] 3d^6 " "#you'd get #" ""Cr": ["Ar"] 3d^5 4s^1#
Promoting a second electron to the 4s-orbial will not bring any significant reduction in repulsion; moreover, you'd pay an energy price for pairing up two electrons in a higher energy orbital, i.e. that would actually cause more repulsion, so this is the final electron configuration of chromium.
Keep in mind that the 4s-orbital is still a little higher in energy than the 3d-orbitals, that is why you remove electrons from the chromium atom starting with the 4s-orbital.
You can use this balance between promotional energy and repulsion to explain the electron configurations of all the transition metals.
Some of them have the 4s-orbital completely filled because this balance between promotional energy and reduction in repulsion is worth paying the energy cost to pair up two electrons in the 4s-orbital.
For example, the electron configuration of manganese, the element that follows chromium, is
#"Mn": ["Ar"] 3d^5 4s^2#
In this case, the reduction in repulsion will justify having two electrons in the 4s-orbital. This will be true for all the following transition metals except copper, which will have
#"Cu": ["Ar"] 3d^9 4s^1#