It does different things depending on what you pass to it:
jQuery(String query [, DOMElement context])
jQuery(String query [, jQueryResultSet context])
This will read the string as a query (eg: #foo > .bar a
). It will be run in the context of context
if it is specified, otherwise it is taken from document
.
jQuery(DOMElement node)
This converts the node into a jQuery result set containing that node. This is used mostly when you have a reference to an element (eg: in an event handler) and you wish to perform jQuery functions upon it.
jQuery(Function readyHandler)
This is a shortcut form of this:
jQuery(document).ready(Function readyHandler)
Running all your jQuery functions once the document has been loaded is so common, this shortcut was added.
jQuery('')
jQuery(null)
This selects the document.