There are a lot of different reasons and factors depending on each different conflict like this. Ultimately you’re asking why governments aren’t better at cooperating with each other and the answers vary from it not being in their best interest to do so, ego, stubbornness, corporate interests, etc.
In the case of situations that are genuinely trivial, which I imagine are fewer than you realise, why should one country give up the land when the other country has equally trivial grounds for wanting it. They both feel that the other country should be the one to give up surely?
Latest Answers