A component is an object designed for a particular requirement. It is that constituent of a system that offers a predefined service or event and is able to connect to other components. A software component is a part of composition with contractually specified interfaces, can also be arranged autonomously and is subject to composition by third parties. The purpose of designing component software is to homogenize the interfaces between softwares so that they are able to work without any glitch.
A Library is an anthology of subroutines that are used to develop software. A library usually comprises of code and data that provides services to various individual programs thus allowing code and data to be shared and modified in a modular fashion. Executables and libraries create references known as links to each other via a process known as linking done by a linker.