
By Moonik / CC BY-SA (https://creativecommons.org/licenses/by-sa/3.0)
Eastern Morocco borders Algeria and has been the limit of Moroccan influence since the founding of the kingdom in the 8th century. Various powers have fought over it, particularly in efforts to benefit from trade, agriculture and mining.

Jewish-Amazigh Leader associated with
Resistance to the Arab Invasion in the 7th-8th Century
http://juifdumaroc.over-blog.com/2017/07/la-kahena-cette-jeanne-d-arc-africaine.html
Prior to the arrival of the Arabs, Eastern Morocco, Algeria and Tunisia were under the control of Amazigh tribes, some of which are believed to have converted to Judaism. Legends are told about the successful resistance of the Kahena, queen of the Jewish-Amazigh Jarawa tribe, to the invading Arab army of Hassan Ibn-Noman at the end of the 7th century. She was defeated in a battle that took place in the Aurès Mountains of Algeria at the town of Baghai, where a statue was erected to her in 2003. She remains a source of pride to both Amazigh and Jews.

by Nicolas de Larmessin
Another legend deals with the resistance of a Jewish Amazigh leader to the Arab Alaouite dynasty leader Moulay Rachid, who is credited with uniting and pacifying the Kingdom after establishment of the dynasty by Moulay Ali Cherif, whose mausoleum is in Rissani, Tafilelt. In the 1660’s, Ibn Mechaal is said to have been a rich, tyrannical Jewish leader living in the Beni Snassen mountains between Oujda and Berkane. Moulay Rachid used a Trojan horse trick to attack and kill him. Supposedly, he used Ibn Mechaal’s money to fund the battles needed to gain control of territory and become Sultan of Morocco.

By Sinforiano Rodriguez, Spanish Worker and Camp Survivor,
https://blogs.timesofisrael.com/moroccos-forgotten-labour-camps/
From Algeria, the French took control of eastern Morocco in 1907, prior to moving on to Fez and establishing the French Protectorate of Morocco in 1912. Their military units in Algeria enabled them to control eastern Morocco during the 1912-1956 protectorate. The French Vichy Nazi-collaborationist government from 1940-1942 established several work camps in eastern Morocco for political prisoners and Jewish refugees from Europe (but not for Moroccan Jews). Many of the workers helped construct a never-completed trans-Saharan railway.
In June 1948, one month after the establishment of the state of Israel and the creation of a network established by the Israeli paramilitary organization, Mossad Le Aliya Bet, to facilitate clandestine emigration of Moroccan Jews to Israel through Oujda into Algeria, riots took place in Oujda and the mining town of Jerrada. As a result, 43 Jews and one Frenchman were killed and 150 persons were wounded.
French officials, historians and Jews originating from the area are not clear about how the riots started or whether Moroccan Muslims, Algerian Muslims or French colonists were responsible for instigating them. Regardless of how they started, the riots in eastern Morocco made Jews throughout the country feel insecure and contributed to their desire to emigrate.