c.1400, "a blow, stroke," perhaps originally imitative of the sound of patting. Meaning "light tap with hand" is from c.1804. Sense of "that which is formed by patting" (as in pat of butter) is 1754, probably from the verb. Pat on the back in the figurative sense attested by 1804.
"aptly, suitably, at the right time," 1570s, perhaps from pat (adj.) in sense of "that which hits the mark," a special use from pat (n.) in sense of "a hitting" of the mark. The modern adjective is 1630s, from the adverb.
1560s, "to hit, throw;" meaning "to tap or strike lightly" is from 1714; from pat (n.). Related: Patted; patting. The nursery rhyme phrase pat-a-cake is known from 1823. Alternative patty-cake (usually American English) is attested from 1794 (in "Mother Goose's Melody, or Sonnets for the Cradle," Worcester, Mass.).