Nuclear deterrence is no doubt part of the reason why major wars have ended, but another reason is greatly expanded international trade. The cost of invading a nation you trade with is much higher than the cost of invading a nation you don't trade with.