Just the other night, my dog showed abstract reasoning capabilities -- my son was training him to find things, and invariably the first place he went to look was to the last place he'd found stuff.
This is such a common phenomenon that we train against it in retriever training.
You teach a dog not to go to "the area of the old fall" by teaching him to run through it on his way to a mark. A more advanced lesson is to handle him to a blind past or through an area in which he found a bird earlier.
It's something you have to work through before going on to advanced handling.
Our best dogs in the club can do "quads" - four birds thrown one after the other, then picked up in reverse order (or as indicated by the handler - that's tricky stuff). My dog is an advanced beginner, but she can do a triple -- throw and shoot three birds, and she will remember where all of them are and pick them up in reverse order.
Some of this talent can be taught, but marking (identifying the place where the bird fell) and memory are innate. Of course, retrievers have been bred for this talent for hundreds of years, so a well-bred Labrador tends to mark like a laser and have a really good memory.
Border collies with all of the herding background have to similarly identify what they're herding (sheep, runner ducks, whatever). They probably have to count pretty high to notice that one is missing, too!
But can he differentiate the balls from the strikes?