Dogs learn through positive reinforcement and our attention....and can learn by watching other dogs. You can see it all in this video.
The owner encourages the puppy to walk down stairs, and offers positive reinforcement. Maybe making the most impact is the older dog, who is appropriately named Simon. Maybe that's why they call it Simon says.