It's a total head-fake.

Well, lookie here: a dog that for all intents and purposes seemed to be a true moron, and one living out the definition of insanity at that: doing the same thing over and over again and expecting a different result. And then, suddenly, he strikes a blow for canine sentience. Good boy.

Sources: AFV