In the ancient Near East, vows were a request made to the deity with a promised gift to be given in return, should the vow be fulfilled. It was almost like a modern-day trade agreement.
In Israel's worship of the Lord this was different. Israel could never buy off the Lord. The Lord did, however, make provision for Israel to show their deep desire to the Lord by making a vow to him. Sometimes Israelites would volunteer persons or property to the Lord as an expression of faith and gratitude (Leviticus 27:1–34).
11 And she vowed a vow and said, “O LORD of hosts, if you will indeed look on the affliction of your servant and remember me and not forget your servant, but will give to your servant a son, then I will give him to the LORD all the days of his life, and no razor shall touch his head.”