When you pat, you tap lightly with your hand. A sad friend might be comforted by a kind pat on the shoulder. But that sad friend would not be comforted by a pat, insincere, comment.
Your grandfather might pat you on the head just like when you were little, even though you're taller than he is now. Dogs like getting a pat on the head, or maybe a pat of butter from the dinner table. When it's an adjective, pat means "way too simple" or "glib," as in "I asked a serious question — please don't give me a pat answer." To "have something down pat" is to know it by heart.