"1+1=2" is a rudimentary concept, which (some feel) should be completely obvious. If you actually had to explain this concept, you might choose to speak in a condescending tone, as if the listeners were very small children, or otherwise extremely naive.
So this expression is a figurative metaphor for Lockhart's pedantic demeanor when justifying the Ministry of Magic's punishment of Hagrid.
Although I've heard this expression before, I wouldn't call it a "common" English idiom. It's just a figure of speech that could be expressed in many different ways. A similar example:
"Yes, of course our President knows what he's doing," her uncle replied peevishly, as if explaining that "the sky is blue" or "water is wet". "If he wasn't competent, he wouldn't have been elected."