A trigger is something that trips feelings or memories related to previously experienced trauma; this results in something that is generally considered unpleasant at best, and at worst causes a lapse in the person who experiences one.
In fanfiction, given the wide variety of stories that are written and the themes, issues, and content that can be found in them, warning for triggers is important and can spare people unneeded emotional pain from reading something that would otherwise cause trauma to resurface.
While some triggers can be vague and are usually general enough that they are possible to avoid through the context of properly labeled warnings, others can be specific items that are difficult to avoid and work off of items specific to the traumatic.
As a whole, fandom tends to have a greater than average awareness in regards to ableism, sexism, and trauma, as many people tend to consider fandom to be, overall, a safe place where they tend to let down their guard in comparison to other environments.
Warning for triggering content such as rape, sexual abuse, torture, or graphic violence is important and should be done as a courtesy for others.