If you publish a book in the United Kingdom, you are supposed to deliver six copies free of charge to the Copyright Libraries for Legal Deposit.
Why should anyone want to do this? Many small publishers including small magazine publishers did and still do so with pride, because a hundred or five hundred years from now - if Man still exists - someone will be reading your work and you will have become part of history. Okay, maybe not in the same way as Shakespeare, but many authors keep one eye on history as much as on their royalty cheques, those who earn any royalties!
Under the 1911 Copyright Act, a publisher was supposed to deliver a copy of every book published to the British Museum (as it then was) - later the British Library - for a personal insight into the British Library including photographs, click here. For some background to Legal Deposit before the 1911 Act, see The Shape Of Libraries To Come under Posterity Before Profit.
Further copies would be delivered to the Bodleian Library, Oxford; the University Library, Cambridge; the Library of the Faculty of Advocates at Edinburgh; the National Library of Wales; and the Library of Trinity College, Dublin. (This is still the case, even though Dublin is now the capital of an independent, sovereign nation). In the modern era, this could be accomplished by delivering said copies to A.T. Smail at 100 Euston Street, London, who was the agent, but a few years ago some bright spark had the none too bright idea of relocating the agent to Edinburgh.
In 2003, the Act was updated in recognition of the arrival of the Internet age, and now it is in the process of being updated again. The British Library has recently published a response to the new draft proposals, which can currently be found here.
The new, proposed act will cover non-print as well as print publications - books, magazines, etc - including web harvesting.
If you publish on-line, you work is probably being archived anyway, by Archive.Org at least (subject to protocol). Legal Deposit is not of course unique to the UK. Depositing your work may also earn you small fees here and there when people order photocopies. In the UK, the Authors' Licensing and Collecting Society distributes royalties to authors.