there are other wars depicted in film like the American Civil War, the Korean War, Afghanistan, etc. but the three most popular settings for War are usually (in no particular order) World War 1, World War 2 and the Vietnam War. I pretty much consider these their own subgenre of War films at this point because they all feel markedly different from eachother. World War 2 is unique because I don't think there's ever been a war as black or white as this one, with clear "good guys" and "bad guys"; the Nazis and the Axis of Evil couldn't be more villainous if they tried with mass executions, fascist ideologies, genocide, horrific scientific experimentation (Dr. Mengele & Unit 731) rape & pillaging, etc. history is always very complicated & nuanced, but WW2 is as clear-cut as it gets in real life conflict when it comes to who's in the right and who's in the wrong and why the opposition needs to be stopped. it's perfect for storytelling in cinema.
WW1 is a bit different. I think one thing WW1 films have in common is depicting the top military leaders, generals & politicians on all sides as incompetent, indicting them in the sacrifice of an entire generation of young men for minimal gains. playing war as a game of chess, throwing more bodies into the meat grinder, neglecting to see the human cost. All three "All is Quiet on the Western Front" did an amazing job at showing the detachment of the top brass from what was actually going on in the war.
Vietnam, and how it's been depicted, is the most morally gray war. there are no clear good guys or bad guys, just the disillusionment of young men that don't know why their fighting in a country they couldn't point to on a map. if you don't know what you're fighting for, it doesn't matter how much of a military superpower you are; you're going to lose. it's also about the dismantling of grand narratives and the war back home, when the American people really started questioning the true motives of their government. Vietnam films are usually more nihilist in tone.
Though I do think Come and See is the best overall war film, the Vietnam trilogy of Apocalypse Now, Full Metal Jacket & Platoon put it over the top as my favourite setting for War films