Eri is a Necromancer, and she can tie souls onto corpses to use them as slaves.
She is controlling all soldiers and maids and stuff, and is planning to do the same on her classmates (She did on one), but they resisted to some extent, and Kaori came and healed all of them, now the plan failed.
Hiyama was the double agent, he is helping Eri, in exchange, Eri will do Kaori's corpse for him, while she herself mainly wants Kouki's. So Hiyama killed Kaori now, but they couldn't take her body because Kouki stopped them.
Also, for those who forgot, the reason the capital is under attack is because the Demons attacked, and Eri is in colab with them, as that demon woman that Hajime killed before when he rescued the classmates, she used that as a messenger from her to the Demon King.