# Difference between valency of nitrogen and phosphorus though both have same valence electrons

Both nitrogen and phosphorus have 5 valence electrons, but nitrogen has valency of 3 while phosphorus has valency of 3 or 5. Why is this so?
Maybe phosphorus can gain 3 electrons or remove 5 electrons.But is it possible to remove 5 electrons? Or is it that phosphorus valence shell is farther away than nitrogen, so it is easier for phosphorus to also remove 5 electrons but nitrogen cannot.
I have searched but i need a concrete answer.

In reality, the situation is governed by the fact that you need more orbitals to accommodate the extra electrons for the two extra bonds. Unfortunately, no orbitals of comparable energy to the $2s$ and $2p$ are available, so the stabilization of the electrons in the putative molecular orbitals would be poor in nitrogen. With phosphorus, you might more readily access the $4s$ and $3d$ orbitals which are closer in energy to the $3s$ and $3p$ orbitals.