Let us imagine a situation in which King Hassan of Morocco convinces his Saudi counterpart to fund a massive project to replace POLISARIO with an Islamist regime. Comparable to the effort that, in our time line, replaced the secular/Socialist/Arab Nationalist PLO with the Islamist Hamas, this project would include the building of mosques, the provision of imams, custom-tailored propaganda, and, the creation, via a program of "scholarships," of a large number of Islamic activists.
At first, the Algerian government is happy that the Saudis are providing so much aid, thereby reducing the burden of caring for the Sahrawi refugees living in Tindouf. Before long, however, the Algerians realize that they have a well-armed Islamist force operating within their own borders. Soon thereafter, they ask Hassan to assist them in dealing with the threat. Hassan is, of course, happy to oblige. The price for his cooperation, however, is Algerian recognition of Moroccan sovereignty over the entirety of the Western Sahara.