Dog behaviour comes down to instinct, past rewards, emotion, physical state and environment. A plain-English guide to why your dog does what it does.