400+ years ago: 6 witches roamed the world. They were calamity manifested, although they had no ill intent.
Ekidna, the Witch of Greed created the Sanctuary to shelter oppressed half-demihumans who had no where to go. She used the Sanctuary as a laboratory for various experiments including immortality. Ekidna creates Betty as her daughter spirit, and takes in Roswaal the First as her apprentice.
400 years ago: Satella became the 7th witch, and was driven mad. She killed all the other 6 witches and devasted the world.
Sage, Dragon, and Sword Saint defeated her but was unable to perish her existence. They sealed her.
The Dragon sheltered Ekidna's spirit in the Sanctuary, so she can continue to exist as a ghost. He did this to have a counter-measure in case Satella's seal is broken. Roswaal continues the research of immortality and devices magic to take over the body of his family line to exist forever, and vows to resurrect Ekidna. Betty becomes the guardian of the library, waiting for her mother's call to free her from her position.