I'll keep it short
Undertale was released, people loved it, but people wanted more content. Toby wasn't going to make more Undertale, so the community did instead. I don't know the exact timeline of how things happened, but basically people came up with the idea of Alternate Universes and Alternate Timelines.
Alternate Universes, AUs for short, are the Undertale world but something changed. It can be something as simple as a personality swap (Underswap) or putting the world in space (Outertale) or changing the entire plot and lore (Reapertale). I think the first Alternate Universe is Underfell, where everyone's niceness meter is switched. So now Asgore and Toriel are extremely mean and evil, Sans is edgy and scared of his brother, Flowey is timid and is carried around by Frisk, etc.
Alternate Timelines, on the other hand, are hypothetical timelines that could exist within the base game. The most popular example would be Geno's story. Geno is a Sans variant that decided to inject himself with DT so that he could beat Frisk. He did, but instead got trapped on the save screen for eternity until he reached out to a different Sans. So it's basically Post-Genocide + Alternate-Pacifist.
These universes and timelines can be mixed together. Underswap and Underfell can be mixed to create either SwapFell or FellSwap (Yes, they are two different universes. SwapFell is Underswap but the characters are edgy, FellSwap is Underfell but the characters are swapped). Storyshift has StorySwap and StoryFell variants.
Then there's the Out!code characters. They originally had a universe, but they don't really belong to one anymore. Ink!Sans's universe was never finished, and he lives off of the creativity of people making new universes, so he made the Doodlesphere to protect them (I think, anyway. It's been a while since I've read some of these stories). Error!Sans, we don't know much about, but he became glitched beyond repair and swore to destroy all anomalies (Everything except for the original timeline and characters [He himself is an anomaly]). Dream and Nightmare were brothers with no relation to Undertale except that the goddess that created them saw Sans' body and soul and decided that it would be the perfect vessel for the guardians. Then stuff happened, now Dream protects the Hopes and Dreams of everyone while Nightmare tries to make everyone have the darkest thoughts possible. There's more, but I think I'm approaching the limit of the comment.