It is very common in babies and young children to have curling of the fourth toe towards the third toe. This is due to the way that the baby has been positioned in the womb. Not all babies have this condition because the big toe is usually the longest, followed by the second, third, fourth and fifth getting progressively smaller in length.
However, genetically some people have longer second, third toes and sometimes also quite long fourth toes. When the fourth toe is straightened from its curling position it is always the same length as the third toe. Normally the fourth toes is much shorter than the third toe. This causes the fourth toe to be curled when positioned in the womb under the third toe from the nature of the fetal position of the baby in the amniotic sac.