The 3,000 volumes then comprising the Library of Congress were destroyed when the British set fire to the Capitol in 1814.  Bibliophile and former President Thomas Jefferson, who in 1802 signed legislation which defined the role and functions of the Library, offered his personal collection to replace what had been destroyed in the conflagration. Considered "the largest and finest in the country", Jefferson's 6,487-volume library was purchased by Congress in 1815 for $23,940.

According to the Library of Congress website:

"The library that Jefferson sold to Congress not only included over twice the number of volumes that had been in the destroyed Library of Congress, it also expanded the scope of the Library far beyond the bounds of a legislative library devoted primarily to legal, economic, and historical works."


BONUS QUESTION:

Who appoints the Librarian of Congress?

Answer:

The Librarian of Congress is nominated by the President and confirmed by the United States Senate.