Wars end with an agreement - do they?

war peace agreement treaty defeat victory

"Wars end with an agreement" I hear from people that also demand that Israel make concessions, but do they?

And what does that even mean? Who are the parties in those agreements?

I am not a historian, I hardly remember what I had for breakfast, but it feels that those agreements or treaties come after either the sides are exhausted and decided there is no point in continuing the war or that one of them had a clear victory and the other accepted defeat.

There actually is a 3rd case. When one side clearly has the upper hand, but external powers aka. the rest of the world forces the winning party to stop pursuing total victory.

I don't know the statistics, but it would be interesting to see which war fell in which group? It would also probably be rather hard to measure. For example:

WWI ended in a treaty and it was clear to both sides(!) who won the war. Did WWII end with an agreement? I think mostly not. Unless we count total capitulation as "agreement". As I understand the Japanese signed an agreement in 1951.

The third group seem to be the case with every war where Israel participated. On the Wikipedia page listing all the wars of the world for each such war Israel is listed as the winner, but in none of those cases did the other side actually accept defeat and basically every war ended by the rest of the world pressuring Israel to stop fighting.

What can we say about the war between Hamas (the elected government of Gaza), the Islamic Jihad, Hezbollah, the Houthies (Yemen), Iran and who knows who else on one hand and Israel on the other hand? The war that was started by Hamas on October 7, 2023.

It seems to be clear that Israel is winning the war again Hamas and Hezbollah, despite the fact that Hamas is still shooting rockets at us, at our civilian population. However, so far none of them accepted defeat.

In fact they all seem to be talking about their victory.

So what kind of of agreement can we expect here? How can we expect the end of this conflict if they keep brainwashing their population into thinking that they won the war despite all the devastation in Gaza?

Why should they stop fighting if they see the rest of the world pressures and condemns Israel?