A DNA library a collection of the multiple DNA fragments that is a population of the genetically transformed micro-organisms (usually bacteria or yeast). Each such micro-organism has a fragment of the library DNA, storing and propagating it.
A cell would not retain and replicate a random piece of foreign DNA inside it. To make this possible, the DNA fragments are flanked by additional sequences, making cell to treat them as part of the own genome.
Types of the libraries
A cDNA library is obtained by extracting mRNA (from a particular tissue or an entire organism) and converting these RNA fragments back into DNA (with the help of the enzyme reverse transcriptase). It represents the genes that have been active (expressed) in the living sample at the time when the mRNA was purified.
A genomic library is obtained by fragmenting genomic DNA into pieces small enough to be carried by the transformed micro-organism. Such fragments from the library then can be sequenced separately, and the DNA sequence of the whole genome can be later re-constructed from the overlapping regions.
Using of the library
A library is a mixture of the transformed micro-organism carrying different fragments. To obtain individual "books", a highly diluted mixture of the library is seeded on the surface of the gel. Yeasts or bacteria will then form multiple colonies on that surface. If it has been diluted enough, each such colony starts from a single transformed cell and contains only one fragment of the library DNA (the same fragment that the initial cell originally contained). Such colony can be later further grown, obtaining large amount of the single fragment of the library DNA. The fragment can be later purified out of the cell and used in various experiments.