A library is a collection of software routines made available to other programs through a well-documented interface.
A library is a collection of software behavior and resources that are available for use by other software programs that are being run on the computer. They may be provided as pre-compiled binary code or as source code. Each version of a library comes with a documented interface.
The difference between a library and a service is that services execute independently of the clients, listening for new communications to come in over a network connection. Libraries don't normally execute on their own; their routines are loaded and executed by the client in the context of the main program.