Knotting is a sub-genre of fic that became popular in the fandom from mid-2010 onwards. The genre overlays canine-type characteristics on people, including pack hierarchies and the idea that receptive sex partners may go into heat. The knot refers to men having a cock that forms a knot when erect, as is found in dogs and wolves. Mpreg is common. The genre is often referred to generally as A/B/O fic after the Alpha/Beta/Omega divisions of pack hierarchies.
There is no single accept set of 'rules' for stories written in the genre, but they usually includes strong themes of dominance and submission, and possessiveness. Some stories will build alternate societal and cultural traditions, while others may be pretty similar to real life.
While there is at least one early fic (from Star Trek: Next Generation - see Fanlore entry below) fandom which utilised a similar feature, Supernatural fandom however, certainly popularized the trope. It originated in one of the fandom's kink memes with the following prompt:
AU - Their world is just like ours...except...in their world there are two types of men. One is the alpha male, the other is the beta male. Alpha males are like any ordinary guy with the exception of their cocks, they work just like dog cocks (the knot, tons of cum etc) The beta male, is just an ordinary guy without the special cock.I'd like to see Alpha male Jared, and Beta male Jensen. Jensen is a snotty prude (think Lady from lady and the tramp) he may be a beta male but he's not just going to let anybody take a go at his sweet little ass...until he meets Jared...then prudey little Jensen turns cock slut for Jared. Bonus points for J2 being OTP, Jensen was a virgin before Jared, and now that they met each other, it's for life. Completely up to you if mating happens just anywhere like in the middle of the sidewalk, in a park etc or on a more private level. source.
The popularity of the fic written in response, started the trend of people requesting more knotting fics and people writing them. This was on the heels of a trend in the fandom of bestiality fic. The social side of the trope - featuring a pack hierarchy with people taking on Alpha, Beta and Omega roles, whether or not knotting was involved, also grew in popularity. Some stories overlap with the werewolf genre, and knotting is very popular on Teen Wolf fandom.