A library is pre-packaged code that is meant to solve a specific software problem.
Use Cases and Examples
Usual occurring tasks in software development are usually packaged into libraries so other developers can use them in their projects or within the same team.
Libraries are usually configurable to allow more room for changes that best suits the developer's need. Jquery is an example of a library that used to be popular when it came to manipulating the DOM elements.
The name library and framework are sometimes used interchangeably, with the latter usually reserved for larger code bases. Some developers and teams open source their libraries to get support from other developers who find them useful.
Here is another article for you 😊 "What the heck is Docker used for ?"