Numbers can play a significant part in Hebrew poetry.
There are six things which the LORD hates,
Yes, seven which are an abomination to Him:
a lying tongue,
And hands that shed innocent blood,
A heart that devises wicked plans,
Feet that run rapidly to evil,
A false witness who utters lies,
And one who spreads strife among brothers.
The two numbers set up a way to memorize a list of seemingly random things. It is a list of six things (parts of the body) that are involved in seven sins that God finds particularly disgusting.
Some numbers have special meaning. The Hebrew word for "seven" is nearly the same as the Hebrew word for "oath." As a result, seven is the number used for perfection. In Song of Solomon 4:1-5, Solomon lists out seven parts of his new bride's body that he finds attractive and then says, "You are altogether beautiful, my darling, and there is no blemish in you" (Song of Solomon 4:7).
The number ten is used to represent something that is whole or complete. In Song of Solomon 5:10-16, the bride lists out ten parts of her husband's body that she finds attractive and concludes by saying, "And he is wholly desirable. This is my beloved and this is my friend, O daughters of Jerusalem" (Song of Solomon 5:16).