From the first family memories, we hug to embrace and show affection for each other. As babies, we are passed around and smothered by family. Growing older, we are asked to give family members big hugs. It is an innocent sign of warmth and acceptance.
Then, when the music starts, we dance together. Our feet move to the fashion of the date and keep track of the beat while our bodies hug. To most, this is the first contact with the other sex.
This male / female hugging to music leads to all sorts of devious behavior, like kissing, but that is for another time.