I understand that at least at some point it was used as a statement of mutual trust, back when honor meant something.
Something I'd love to know as well (the ritual in my flare 'homage' is one such hand-having ritual) however, the roots of the handshake might be pre-historical and as it seems to have developed independently in various distinct historical and geographical regions the answer might be better provided by /r/AskAnthropology.