The handshake is a gesture with a greeting valence but it can also be used to indicate thanks, agreement, congratulations.
It is carried out between two people who reach out and hold each other's hand (usually the right hand), often making a more or less marked up and down movement with their hands together. It is a very ancient gesture common to many cultures, sometimes with variations (for example in North Africa it is accompanied by the gesture of bringing the free hand to the chest by the two who shake hands).
The custom goes back to antiquity and in Europe its use was born among the Lords of different families, clutching the forearm to confirm that there were no white weapons hidden in the sleeve, over the centuries the greeting has changed into what we know today.