According to Urban Dictionary, smut "is a story, usually a book or a fanfiction, that includes one or more sexually explicit scenes."[1] As an example, the website fanfiction.net uses "tags" to describe posts, and one such tag is "smut." Consider the following Glee fanfiction from 2010 using this tag:[2]
Title: Because Everyone Loves a Bit of Skirt
Description: Blaine and Kurt are home alone. Kurt is wearing his skirt. Blaine sees this as an opportunity. It's all going fabulously, that is, until the rest of the Hudmels arrive.
Tags: Klaine Blaine/Kurt S!kurt, Rated M, Semi-public smut, Oneshot
Starting as a Middle English word referring to dirt and indecent language, smut has gone through significant changes to reach its use as a descriptor for stories on the internet. There was at least one large change, around the 1960s, where the word stopped being used for fungi and started having sexual connotations, for example, with Tom Lehrer’s song Smut.
Around the 2000s, smut appears to have an agreed-upon definition amongst people on the internet: sexual works of writing. Smut functions as a neutral descriptor, appearing in both positive and negative contexts.
Smut has an interesting linguistic history and current use. There are several similar definitions for the word, from Narida Law's essay to Urban Dictionary to Murray Davis' book, but there is no strong definition given from formal literary circles. This grassroots history of the word smut on the internet could play a large part into why it is used on fanfiction sites. In fanfiction communities filled with writers driven by passion and not money, smut's origins align with how internet groups form: sporadically and without a clear beginning.
[1] https://www.urbandictionary.com/define.php?term=smut.
[2] https://www.fanfiction.net/s/6502526/1/Because-Everyone-Loves-a-Bit-of-Skirt.