If I mean to ask the main causes of something, so I want to know what something reacted to, can I say “what was the war a reaction to?”? It sounds pretty weird to me... I’d rather say “what did the war react to?” Are they both right? Are they both wrong?
Neither is incorrect, but in my opinion both are awkward.
what did the war react to?
Implies that the war is like a living thing which can react to other things, which it isn';t, unless you are intending to personify "war" or "the war".
Simpler and more straightforward woudl be
What were the major causes of the war?
What factors contributed to the outbreak of the war?
One could use "consequence" instead of reaction, as in:
What was the war a consequence of?
But I still think this a bit more awkward.
One should remember that a war pretty much always has multiple causes and use a form which permits multiple answers. I recall a historical writer saying:
Whenever I here someone say "The cause of the Roman Civil War was..." I know he doesn't know enough about the subject to be worth listening to.