A pat on the back is a physical way of conveying one of many messages. It is mainly a form of praise — a way to say “good job” or “atta boy." It could be a congratulatory act or just a physically intimate way to say "job well done." It expresses the praise differently than the verbal message would, and is a way of conveying a physical closeness or intimate proximity.
A congratulations in an athletic event is often given as a pat on the back. This gesture has been used since the inception of sports — to celebrate a home run, to congratulate a goal scorer, or to celebrate a catch. It is a form of praise from a coach to a player, or from a player to a player. It expresses a physical joy that words do no accommodate.
It can also be used by a father to encourage a discouraged son or a leader a discouraged follower. The pat can be a reassuring form of praise. Another way of saying “atta boy,” the pat can say, “get ‘em next time." It may be used to praise a player, son, friend, teammate, or anyone for a job well done but not successful.
A pat on the back may also be a way of consoling someone who is sad, upset or hurt. It is not always praise, but can also be comforting in this way. It can be a way of saying, “I’m here for you” or “I’ve got your back,” as well as being a form of praise. All these forms express the need and importance of physical intimacy and affectionate touching.
This form of praise or comfort can be a good option when words are not necessary or practical — when words are too loud or emotional. It can be a confident exchange between an otherwise awkward pairing or a communication more easily understood than words. It is reassuring as a universal form of praise. It can even be an encouragement to onesself, as in "Give yourself a pat on the back."