It does not re-query the DOM, this already an element. jQuery simply sets the context for the element, adjusts the length, and returns itself. This code is from the init function, which executes when you execute $(something) , this is part of the big if..else , where it also checks selectors, arrays by the way:
// HANDLE: $(DOMElement) } else if (selector.nodeType) { this.context = this[0] = selector; this.length = 1; return this;
So basically it just wraps the element in a new jQuery object.
source share