A forced surrender only happens when one side reaches zero war support, so to avoid it you must keep positive war support. This can be tricky when you face multiple ticking penalties (surprise war, ideological proximity, sphere of influence...) that force you to prioritize war support gains. Losing a big battle--in particular, losing many more units than your opponent--can deal a blow to your war support.
You understand correctly that winning battles and occupying cities are major sources of war support. It is useful to know that forcing retreats increases your war support as well. If you find that an opponent has relatively few units, it can be useful to focus on retreats instead of battles to "farm" war support. The civic Materials Procurement and the Forbidden City wonder both give one-off bonuses to war support on declaring war.
When at war, looking at war support levels can tell you when you desperately need to win battles just to stay in the fight and when you can regroup without fear of a forced surrender.
In this
Humankind is far closer to Reality than any other 4X game so far.
Look, for a good example, at the history of Frederick the Great of Prussia: won over half of his battles, some incredibly one-sided (Rossbach, Leuthen), but kept losing men at almost the same rate at his opponents who all had far more resources (read: War Support) than he had. He was about to lose the Seven Year's War completely ("Forced Surrender") when the death of Ekaterina of Russia caused the alliance against him to collapse and he clawed out a negotiated "victory".
Or, for another German example, the Nazi state in 1941: won some of the most amazingly one-sided tactical/operational victories in history, captured over 3,000,000 Russians, occupied most of European Russia - but in the process lost 25% of their total attack force and over half their tanks and equipment, while (in Game Terms) the USSR had a firmly-established Communist system and Stalin, both of which gave increased War Support, and so the Germans could not force a surrender or obtain a victory. By 1945, War Support collapsed in Germany (in the units of the 6th SS Panzer Army, probably the most die-hard of Nazi fanatics, morale collapsed in March 1945 and the divisions disintegrated into small groups running for safety, while in the rest of Germany civilians were begging the German army remnants not to fight for the towns for fear of Allied air and artillery response: that's Collapse in my book)
Serious military historians and practicing Generals have long recognized that destroying the enemy's Will to fight is much more likely to cause a war to end successfully than trying to destroy his Means to fight, since an enemy with a Will can always find the Means, but once his troops no longer want to fight, or the civilians want to sacrifice, it's Over.