I think the short answer is that the magic function is expected to work as the quotation brackets do capture their local variables (in a way). Essentially, compile-time local variables in quotation brackets get replaced with their literal values and become run-time constants. This is achieved by calling the lift function implicitly, so that [| .. var .. |] becomes [| $(lift var) |].
Perhaps you are confusing this behavior with the fact that they capture local variables uniquely, such that repeated calls of the same quotation will not interfere with one another's variable names. This is is achieved through calls to newName behind the scenes, which ensures unique variable names.
If it helps, I personally think of the quotation brackets as "splice generators" - little fragments of Haskell code that will be converted to an AST at compilation time and will therefore become splices ready to be inserted wherever. As pointed out by Bulat's tutorials (links from), they act like a form of macro pre-processor, as they are mixtures of Haskell functions generating code and simple automated conversion of haskell code to TH AST.
Edit: Seems ehird beat me to the answer - I am leaving my answer around, in case it provides some additional value.