Usually, books turn yellow because of the effect of sunlight on the paper. This is especially true in the case of mass market paperbacks, which are produced on a woodpulp paper that is treated with sulphur in the production process. Over time, the exposure to sun and to air will cause the paper to turn yellow, and eventually brittle. This is a severe problem with libraries and archives,who have the ability to treat the paper with chemicals and stop the decomposition of important documents, but that can be very expensive,and not available to ordinary people.
If you have a particular favorite book, you might consider buying a good quality copy of the hardcover edition (new or used) . Usually, these copies when first published by the major publishing houses are produced in better quality paper. These are the copies that large public libraries buy, since they tend to withstand lots of use better, and will not turn yellow as soon.Those hardcovers published by book clubs, etc, are usually of a cheaper paper, and the mass market paperbacks are the least durable of the three.
Dust mites , mold and mildew are another problem, along with bookworms in older libraries. Dust mites are living organisms that can be controlled by lowering the humidity of the area where you store the books. This can be dealt with by simply dusting the books regularly, airing them out occasionally, and keeping them in bookshelves that don't allow the buildup of dust. Just a feather duster will help, and not allow the area to become too damp or too dusty. A higher quality paper will also be less likely to develop "foxing", or those brown stains you sometimes see on old books or papers.
Here is what a website says of "foxing" Foxing is a term describing the spots and browning seen on old books, documents, postage stamps, and so forth. The name is believed to derive from the fox-like reddish-brown color of the stains.
While unsightly, and a negative factor in the value of the paper item for collectors, foxing does not affect the integrity of the paper.
 Causes of Foxing
The causes of foxing are not well understood. One theory is that foxing is caused by a fungal growth on the paper. Another theory is that foxing is caused by the effect on certain papers of the oxidation of iron, copper, or other substances in the pulp or rag from which the paper was made. It is possible that multiple factors are involved.
It is believed that high humidity contributes to foxing.