The first one adds a utility function to jQuery, which will be called $.myplugin(...)
.
The second one adds a plugin that acts on jQuery objects, which will be called $(selector).myPlugin(...)
Choose the latter if you are working on a plugin that acts on elements and can be part of a jQuery-style function call chain.
source share