Why is this a thing? The war was going just fine for me, total war was just at -23%, but my ally peaced out and conceded my territory? Is this a bug or WAD?
The only thing the defender can give, is the stuff on the list of war demands. So first the attacker was going for your territory to begin with.
A war at -23% is far from "going well". It sounds more like you left your ally to fend for itself, while you were busy with another war. And they were getting thier ass handed to them.
Indeed 20% is actually the point at wich negotiations with demands can be made.
So here is what likely happened:
You were allied with someone.
You started a war and thus your fleet was occupied.
Another AI saw the opening. It declared war on your ally, but for your territory. Propably wanted to avoid any additional defense pacts you had running (I did stuff like that myself).
You did not comit forces to the war. As expected, the allied AI was incapable to defend the territory on it's own.
The warscore reached the point where the attacking AI could negoiate with demands. The sugested demands gave a positive result. The AI relented on the war demands, to avoid further damage to it's infrastructure.