The consensus in the western world changed, yes, with the advent of the notion that countries belonged to the people who lived there, not their rulers, i.e. with the spread of democracy.

That didn't happen overnight, and it took time for international institutions to be created to police those rules, but by the middle of the 20th century, it did.

The creation of Israel by Britain was one of the last cases of a colonial power deciding it had the right to give land to someone without regard for the existing population.

it is still a principle that creates controversy, as with all the separatist groups in the world claiming all they need is to win a referendum to separate, while the country they belong to refuses to accept that principle. Who does land belong to, a government, or the people living there?