The custom among many is to give a child his first haircut at the age of three. Many go to Meiron to the grave of R’ Shimon Bar Yochai to do this. In fact, the Arizal took his young son with his family to the grave of R’ Shimon Bar Yochai and gave him a haircut (upsherin) there on Lag Ba’omer, followed by a celebration.
The Ateres Yeshua shows us an allusion to this custom. The word והתגלח, which is written with a peculiarly large ג, alludes to that at age three (as ג has a gematria of 3), we do והתגלח, give a haircut. Additionally, this word, והתגלח, is found in the 33rd pasuk in that chapter, which hints to performing the upsherin on Lag Ba’omer, the 33rd day of the Omer.
R' Ovadia Yosef remarks that some are accustomed to perform an upsherin on Lag Ba’omer in Meiron. However, nowadays where there is a breach in tznius there on Lag Ba’omer, it is better not to go (Shev V’al Taaseh Adif).
This first haircut is called a חאלאקע (chalaka), from the term איש חלק, smooth-skinned man, since when one has an upsherin, he now has a smooth head.
We have a principle known as a ערלה, the first three years of a newly planted tree or its grafted shoots, is forbidden for use. Since man is compared to the tree of the field (כי האדם עץ השדה), we therefore don’t touch his hair for the first three years. In the fourth year all its fruit is קדש הלולים לה', sanctified to laud Hashem. So too, on the beginning of the fourth year of a child, he is dedicated to Hashem as we introduce him to the Torah.
Indeed, this is why we have a celebration by an upsherin.
