The demons that existed in the novel start to appear (‘for some reason’) marking the first steps towards the insanity developing. In order to not beat around the bush, here’s a brief summary of wtf exactly happened in part 2.
Rei, the one we know and love, is a clone of the real Rei from a sci fi future version of Earth. The real Rei is a genius scientist, who together with Clair (who developed the most advanced AI known as TAIM), was able to preserve the entirety of humanity by storing their souls as information and using nanomachines to clean up the earth and reincarnate the whole of humanity after discovering what she labelled as “magic, ” although in reality it’s a form of energy that can be materialized by the use of nanomachines. The real Rei is the only administrator for this, as she kickstarted it because Claire was suddenly infected by an unknown pathogen with no methods to cure/treat her (for some reason). After millions of years where the real Rei watched humanity go through a magical medieval era and a normal earth era into destruction hundreds of times, each to be looped back into the other type of era (world setting makes more sense now that I think about it), the real Rei realizes her feelings for Claire start to wane, so she decided she must destroy humanity (which would normally only happen if some sort of bug in the soul information storage caused humanity to suffer something considered inhumane for eternity). After steeling herself, she realized she couldn’t really kill Claire herself, so she made the demons (in the current loop where our Rei is in), specifically to kill Claire and erase her soul’s information, eventually labelling herself the demon queen. TAIM (Claire’s AI), watching her mental state deteriorate devised a way to corner the real Rei, that was to create our Rei. There were failed creations (eg the pope), that look exactly like her, but eventually this one was created, which leads us to chapter 240, the end of part 2, that is, now it is known the real Rei can’t do anything that can harm Claire, she’s planned to be used as a pseudo human shield while Rod, with his new complex magic he made (somehow), that is able to damage the real Rei, is going to deal the finishing blow, at least that’s the plan as of c240.