Fan fiction on Livejournal traditionally includes a Fic Header which includes a warning for story elements that readers may wish to avoid for a diversity of reasons. These range from the serious eg topics which may be extremely upsetting (sexual assault) through to personal preference for certain narratives (ones where characters don't die).
Many readers do not like being surprised be the appearance in the story of a pairing, character or situation they don't like, and would like all possible elements listed in warnings. There is sometimes a tension with authors who do not wish to disclose plot points or situations ahead of the story, or feel that warning puts a negative connotation onto something eg warning for Slash may be seen as homophobic.
Warnings often end up being an "advertisement" for the sexual kinks in a story. Spoilers may also be warned for.