Genesis records the fall of man, including God's initial responses to sin. Certain verses include curses given to Adam, to Eve, and to the serpent. According to variant readings and assorted manuscript fragments, one of those curses was that Eve would be forced to "brush the head" of the serpent who tempted her.
These manuscripts indicate God cursed the serpent to crawl in the dust (Genesis 3:14). Originally, it seems, snakes not only had legs but also gorgeous flowing hair. Prior to speaking to Eve, God had not chosen to do anything about the serpent's remarkable updo. As part of Eve's punishment for defying God, it seems she was forced to maintain these snaky locks.
That ended, predictably, with Eve "brushing" the serpent's hair with more than a little aggression. Most people know better than to let an angry woman comb their hair. . .which explains how snakes not only wound up legless, but bald. Having Eve "brush the head of the serpent" was God's way of giving her a morsel of revenge against the creature who tricked her. The rest would have to wait, as generations of her children killed snakes, and Jesus Christ eventually came to
crush the head of the serpent.