This particular posture became associated with praying around the ninth century, it probably originated as a secular gesture of humility and submission, such as one would adopt before a superior.
The identical gesture is known as the anjali mudra (offering gesture) in Hindu and Buddhist traditions, a sign of greeting, respect, and veneration. The anjali mudra is used while praying, and also as a gesture of respect toward others, an acknowledgement of their inner divinity.
Symbolically, two hands clasped represents the coming together of opposites, or a commingling of forces. Magically, the hands are the terminus of the body’s polar energy sources, and can be used to channel and direct these energies.
Albrecht Durer’s famous sketch