Do countries IRL even follow it? I’m not sure if they do or not, It would be nice if they did, but I don’t think all of them do.
The Geneva (regulating treatment of civilians, prisoners of war, and non-combat personnel such as chaplains and medics) and Hague (regulating which weapons are permissible in what contexts) conventions are very much followed IRL. Where things get messy is dealing with insurgents, terrorists, and non-state combatants - these are not explicitly protected by the Conventions, and most countries have a... less than stellar record of humane treatment of such persons. There is, of course, a great deal of misconception on what the Conventions actually cover, sometimes making their way into actual military training, but those tend to be more strict than the actual text, not less.
The purpose of the Conventions is that certain tactics (bombing hospitals, strafing refugee columns, poisoning water supplies, permitting no prisoners) and weapons (poison gas, blinding lasers, small explosive bullets, etc.) will give a significant advantage if one side is using them, but the advantage will cancel out completely if all sides are doing so. Thus, the only thing they do is make war much nastier for everybody without changing the outcome of the war even slightly. Thus, almost everyone agreed to a set of "we won't do this as long as you don't" treaties to keep the nastiness down.