A plugin is a kind of Joomla! extension. Plugins provide functions which are associated with trigger events.
What is a plugin?
Plugins or extensions are software components which connect to the main software component and extend their functionalities.
These are used extensively to extend the core functionality of software like Joomla, Wordpress, browsers and so on. These are generally light and also known as add-on, extensions and so on.
Joomla Plugins are grouped together depending on which event they run on. A full list of plugins grouped by event type can be found here.
The Joomla! plugin architecture follows the Observer design pattern. The JPlugin class provides the means to register custom plugin code with core or custom events. The JDispatcher class (JEventDispatcher in Joomla 3.x) is an event handler which calls all plugins registered for a particular event, when that event is triggered.
A tutorial for basic plugin development can be found in the Joomla! Documentation.