Why, most of the time, do we use our right hand ?
According to scientists, 90%+ of Humans use their right hand as the predominant one. It's because of the lateralization of the brain and has been like this for thousands of years according to some studies, such as this one: David Frayer - University of Kansas) or, more broadly, to Laterality - Wikipedia.
Therefore, it is used to perfom most of human activities, from nice ones (so many, you name them), to needed ones so one can live (such as till the land, grow produce, hunt), and, unfortunately, to others like fight each other and kill.
Why do men shake hands with men ?
The right hand being able to threaten and harm, it becomes pretty obvious that, through times and history, men have seen this gesture as a matter of peace: I show you my hand, you can take it, so you'll see I can't use it anymore to harm you. But not only... The Blood Brother Oath involves holding one's hand. So, we can understand it as a willing of no harm, a greeting, or a farewell.
Why hug someone ?
Hugs-and-kisses (xoxo in written) is used for expressing sincerity, faith, love, or good friendship. It originated in the Middle Ages, according to Wikipedia - The christian cross. At the time, you were not able to meet as much as you wanted someone who lived far away from you, nor hugging/kissing her/him really often. Therefore, the X with a kiss on it at the bottom of a letter was a way to express your feelings. NOTE: this, as most part of any country was not educated, was used by wealthy people, upper-class persons, who had time/money to learn, and where able to read and write.
It's worth thinking that it may have roughly be transposed from writing to a (token ?) gesture.
Another possibility is the transfer from parenthood/childhood to, slowly, a wider span of the human spectrum: family -> relatives -> close ones -> friends -> ???
As a father/mother/elder, in almost any culture, a very young one is hugged whenever s/he is afraid. Hugging make feel the cozy, emotional, human warmth. To both. One can do it to help and give, or in order to feel better themselves: I did something nice reassuring someone who needs support, feels intimidated, or is frightened. When confronted with it, every individual may take it differently, POV are not always shared.
The "bear hug", even if soft and smooth, can be seen as a domination gesture. It's invading one's privacy, because it shows (whether you mean it or not) your strenght, opposed to the other's (supposed) weakness. The same can be feeled when confronted with the "cheeks-kissing" that is common in some countries/cultures. It's not a matter of domination, rather privacy violation.
Man to Woman relationship and way of greetings
About your 100 years ago part: it used to be hand-kissing. In Europe, it shows respect and humility, as the man has to bow to the woman. It was to be done to married or high-ranked women (such as Prime Minister / President / or their wife). It's still used when asking a woman to marry you in some countries/culture.
When it comes to adults, same gesture, different story though...
As usual, when you talk about such a personal matter, culture and background are important 1, as also mentioned by Lesley Téllez in her "proper American goodbye" 2 or Maralee McKee ("manners for great greetings") 3.
From Verily: the University of Oxford study's results indicate that when it comes to interacting with strangers and acquaintances, men feel more comfortable being touched. In general, women don't feel comfortable being touched by strangers and acquaintances — not too surprising. 4
Why do men shake hands with each other but hug women?
It's not as if we have centuries of history of men hugging women. It's new. ( Catija♦ Aug 17)
Yes. Things change. Habits change. And when this happens, rituals are comforting. These rituals modify, adapt or alter themselves along with the society changes, and are kind of "vogue".
1 Pocket cultures - Kiss, hug or shake hands?
2 Hug or handshake? The proper American goodbye
3 Maralee McKee - Manners Mentor
4 The University of Oxford - Topography of social touching