What happend in this war? Who won'd the war? And why did they declare war at each other? I know that the question is irrelevant but in the day it just a question
There were three factors that caused the conflict.
The lack of a clearly defined border between Morocco and Algeria led to a number of different borders. The Trinquet and Varnier Lines were the official borders set, but due to differing maps they were often misidentified and left much room for debate. [1][2] A mutually recognized border was located roughly in between Oujda and Maghnia, corresponding to the modern day borders, but it only went about as far south as the Tlemcen-Naama Provincial borders in Algeria today, or about 150 kilometres in length. That's about 10% of the modern day border in length.
As a result the rest of the border was contested. The disputed land was just desert with next to no residents south of the Draa River, however resources had been discovered in the early 1950s, notably oil, iron and manganese, which gave motivation for both Algeria and Morocco to push for control over the land. Algeria had been administrating the region since the discovery of the resources, integrating the settlements of Tindouf and Béchar into Algeria
While Algeria had legal ownership of Tindouf and Béchar, it didn't have a history of owning them. When Morocco ceased to be a French protectorate, they demanded the return of the settlements but France denied it. This plays into the third factor: Moroccan nationalism. the Istiqlal Party led by Muhammad Allal al-Fassi was its at height of success and the even more radical National Union of Popular Forces was doing well as well. Combined, these two parties had won 55% of the vote in 1963. The Greater Morocco ideology these two parties shared didn't just envision a reclamation of Tindouf and Béchar, but a Morocco going as far inland as Adrar and as far south as Timbuktu, corresponding to a portion of land even greater than the Saadi dynasty's historic extent.
As for the war itself, it wasn't anything significant. Small-scale skirmishes for four months around Tindouf and Figuig that resulted in anywhere between 39 to 200 Moroccans [3][4] and 60 to 300 Algerians dead. [4][5] The war did not result in any territorial changes, and Morocco has since dropped the case for Greater Morocco. The Istiqlal Party today is still around, the third largest in the country, but no longer holds to the uncompromising ultra-nationalism of Allal al-Fassi.
[1] Frank E. Trout Morocco's Saharan Frontiers (1969)
[2] A.S Reyner, Morocco's international boundaries: a factual background (1963)
[3] Stephen O. Hughes, Morocco under King Hassan (2001)
[4] Micheal Clodfelter Warfare and Armed Conflicts (3rd edition) (2008)
[5] Alexander Mikaberidze Conflict and Conquest in the Islamic World: A Historical Encyclopedia (2011)