My dogs have a certain spot, which when I scratch will cause their legs to start twitching and shaking as if they were scratching the spot themselves. Their lips also stretch back like they're smiling. Why do they do this?
You are eliciting a Scratch Reflex* that is located in the animal's spinal cord. The urge to itch is involuntary.
As for the "smiling" aspect, I don't know how that relates to the scratch reflex, but I can only surmise that it's similar to a minor grimace that a human might have while they are stretching their muscles.
*Warning, skip the article if you are sensitive to descriptions of animals being used in research