The Battle of Roncevaux Pass was a military engagement (despite its name, it is questionable whether it was really a battle) that occurred in 778, where a group of Basque fighters pillages the rear guard of Charlemagne's army as it exited Spain after an unsuccessful campaign.
The background as to why Charlemagne was in Spain is, as most politics of long ago are, almost totally incomprehensible. There is a reason "byzantine" became an adjective. Basically, there was a war between two different Islamic factions in Spain, and Charlemagne intervened, in alliance with one side. The war did not go well, and while in the process of exiting, a totally unrelated group of people, ambushed the rear guard of the army.
Despite its name, this is probably only marginally a "battle". As far as I can tell, there was no political motivation or desire to control territory involved in the battle. It actually seems like an act of banditry against a target of opportunity. And in fact, since the only historical record of it was written by Charlemagne's army, it isn't totally out of the question that the rear guard was caught by a natural disaster, such as a flash flood, and it was just mistakenly or purposely blamed on the Basques.
Despite the narrowness of its historical importance, and even of the historical evidence of it having occurred, the battle was immortalized as an epic battle in The Song of Roland, where the forces of Christendom fight a doomed yet valiant battle against the insidious treacherous forces of the Muslim world. The portrayal of the battle in the Song of Roland is about as far away from the actual Battle of Roncevaux as it could possibly be. The real battle was neither epic or gigantic, being a simple crime of opportunity, and neither was it part of a religious war: Charlemagne's Christian forces had been fighting on one side of a Muslim civil war, and were then ambushed by (at least marginally) Christianized Basques. And yet the tide of anachronism is hard to stem, especially in poetry.