#"PCl"_5# is a pretty nice example.
With five single bonds, phosphorus has #10# valence electrons.
Due to the Pauli Exclusion Principle (two electrons cannot have entirely matching quantum numbers), normally only #8# electrons are allowed in the #3s# and #3p# orbitals combined (the octet "rule").
However, since phosphorus can additionally access the #3d# orbitals, it gains more quantum states for the electron. The #3d# orbital, if fully utilized, has the potential to allow an extra #10# electrons if it was ever desired (#2# per orbital, #m_l = -2,-1,0,+1,+2#, thus #5# #3d# orbitals, and #2xx5 = 10# electrons).
This is possible because phosphorus's #3p# orbitals are close enough in energy to the #3d# that it can access them if it needs to (notice how #3d# and #3p# have the same #n#).
From this, we can say that phosphorus places its extra #2# electrons in the #3d# orbitals when it needs to become hypervalent (expand its valency) to make all the bonds that it is prompted to make.
Some other examples are:
#"ClF"_5# (square pyramidal)
#"SF"_6# (octahedral)