According to "The Knight, The Lady And The Priest" by Georges Duby folding hands together when praying has its origins in the warrior culture of the early middle ages. Lesser nobles used the gesture to signify subordination when they took oaths of fealty to lords of higher rank. They, or rather their siblings who entered the church, then transposed the gesture to the act of prayer, which was, according to their world view anyway, an expression of subordination to the highest lord of all, namely God.