So, a lot of the initial libraries were basically just functions that would check which browser the visitor was using and then work around whatever issue or shortcoming this browser might have, to ensure that everything worked as intended, no matter what.
Most developers would just keep their libraries to themselves, or within the company they worked for, but some libraries were released to the public, usually because they added functionality that was deemed important to a lot of developers. The release of these libraries allowed other developers to chip in and add even more functionality, while perfecting the existing.
During the following years, jQuery received continuos updates, allowing the end users to do more and more. Examples of this is AJAX requests, animations and a heap of utility functions, basically just making it easier for the developers to accomplish simple and advanced things with few lines of code.
Of course, the success of jQuery spawned a LOT of competing libraries. One of the first ones was mooTools, which was released in 2007, but this was just the tip of the iceberg: While jQuery kept growing the amount of functionality, other developers insisted on releasing slimmer alternatives to keep the size and complexity to a minimum, or libraries which simply did things completely different.
jQuery usage: Now and in the future