War is, for better or worse, quite common in science fiction. If you want to use it you need to understand at least a few basic things. There are in fact books written on it. I am just going to start with the most basic ideas you need to understand.
First you must understand the goals of each side.
To give a real world example think of the American revolution. The colonies lacked the ability to get even a small military force across the Atlantic. They had zero chance of bringing the British to their knees. Yet they won. They could have lost every battle and still won the war. The goal was to make the cost of victory so high the British were unwilling to pay it.
The strategies used were very different then during the second world war. Both Imperial Japan and Nazi Germany launched wars of naked conquest and greed. They had to be beaten back tooth and nail. Both sides reached the points of no return, where victory was not even remotely possible (far before the end) yet they kept fighting.
The goal of a side in war might be simply stated “Make victory cost too much” but it informs everything about how that side fights.
There are times when there is no national goal. This almost always this means someone is meddling. Someone is pushing leaders of one nation into a fight against their own national interest for reasons of their own. If this is the case you need to understand that too.
Modern wars are at least as much economic contests as military ones. Germany’s tanks were better, but the allies had 4 or 5 tanks for every German tank.
When a country is gearing up for war, it affects almost everything about life there. During World War Two whole industries were revamped. Car production stopped for a few years because tank production was more important. Copper was so important for the war effort that the Manhattan project had to use precious metals from Fort Knox when it needed a huge amount of wire.
When a country is at war it completely changes the economy. One of the more subtle ways of showing a country is at war is to start off with showing the economic effects.
A nation can act selfish, but have selfless solders. This is not a contradiction. When I was first learning about World War Two in elementary school, I read something that stuck with me to this day. It was about how when the Japanese emperor went on the radio and surrendered, a peasant was ashamed because she felt that they had failed him.
No one can blame the solders of Imperial Japan of selfishness. That however is the very thing that Japan as a whole was most guilty of. The war was little more then the people of Japan seeing something across the sea and deciding that they wanted it.
The point I am making is that a nation can and often does act in ways that the individuals who comprise it never would. It is a somewhat scary part of human nature that people will do things for their children or their nation that they would never do for just themselves.
While a number of limited wars have occurred of course, they do tend not to happen when both sides feel in danger of being wiped out. I find it hard to believe, for example, that if a nation had nuclear weapons that they would not use them in a do or die situation. It is the same with chemical and biological weapons. In such a situation you would no more hold back than if you were in a knife fight and had the chance to kick someone in the balls. Few would restrain themselves if they thought it was really do or die.