The origin of the Nazarite vow. This is a way of setting apart a person as a holy man. Samson was a Nazarite. By then he was a demonstration of how corrupt the promise had become.
The themes are similar to the clean and holy notions of Leviticus: no contact with the dead, not cutting hair, etc. This was like a voluntary extra giving of a life to God bring the notion that the first born was God’s.
I imagine if a birth was difficult or a child nearly died of an illness, a parent might pray “deliver him God and I’ll devote him to you”.
It could only be a male.