The Globes and Maps we use to describe the physical political worlds are not always accurate. Not in the sense that the actual land is not there, but in the sense that the countries occupying that land may not be correct.
For example, for a long time, Tibet was listed as a separate country, even though it was - in reality - a province of China. There are a few mistakes that have been on our globes for a long time (and probably won't change for a while).
First - Western Sahara - (labelled as Spanish Sahara on older maps)
In 1975, Spain withdrew from their colony the Spanish Sahara (in the 1970s Spain and Portugal transitioned from Autocratic Dictatorships to Democracies - both abandoned their colonies quickly after the transition).
There was a generally acknowledgement that the colony should decided itself what to do, but Morocco and Mauritania both invaded immediately. Morocco won the better of the deal and controls most of the territory, the great majority of the population centers and production.
Mauritania captured some areas and was almost immediately embroiled in a local civil war. After a few decades, in the 1990s, Mauritania relinquished it's power to the local population, called variously the Polisairo Front - the rebels as support primarily by Algeria and the Sahrawi Republic - the political entity. But the Polisairo Front was not nearly as strong as the Moroccan Army which took control of most of the areas Mauritania withdrew from.
The "country" is essentially ruled in this format...
No easy resolution presents itself as Morocco shows no sign of leaving and the world doesn't really care that much. But most countries don't want to acknowledge the facts on the ground. So the maps show a snapshot of the area that is 40 years out of date.