Yes, but it doesnt do so because it understands what a variable is, it does so because it has statistics as to where variables belong most likely.
In a way it is like the guy that won the french scrabble championship without speaking a single word of french, by learning the words in the dictionary.