This was not entirely arbitrary on Charlemagne's part. His father, Pepin the Short, had trouble with Basques, who were a significant part of the Aquitainian army that Pepin fought and defeated. The Basques had submitted to him in the late 760s. Charlemagne perhaps wanted to express his frustration at accomplishing nothing from the agreement with al-Arabi, and used his army to "blow off some steam" by tearing down the city walls of Pamplona.
What Charlemagne should have realized was that the Basques would not just sit back and lick their wounds. As he headed north, the Basque army followed him. To get through the Pyrenees, the Christian army chose the Ronceveaux Pass. The rearguard was led by Roland, warden of the Breton March.
Curious point about Roland: in all recorded history, he is mentioned only once. Einhard in his "Life of Charlemagne" tells the story of what happened when the Basques caught up with the tail end of the army at Ronceveaux on the evening of 15 August 778:
That place is so thoroughly covered with thick forest that it is the perfect spot for an ambush. [Charles's] army was forced by the narrow terrain to proceed in a long line and [it was at that spot], high on the mountain, that the Basques set their ambush. [...] The Basques had the advantage in this skirmish because of the lightness of their weapons and the nature of the terrain, whereas the Franks were disadvantaged by the heaviness of their arms and the unevenness of the land. Eggihard, the overseer of the king's table, Anselm, the count of the palace, and Roland, the lord of the Breton March, along with many others died in that skirmish. But this deed could not be avenged at that time, because the enemy had so dispersed after the attack that there was no indication as to where they could be found. [source]
The attack was completely unexpected, and the Frankish forces were in disarray. The lightly armored Basques had the high ground, and were successful at cutting off the rear guard from the main part of the army. The Franks fought as well as they could, and arguably succeeded in keeping the Basques focused on them, allowing the main part of the army to survive, but Roland and his part of the army was slaughtered by the Basques. In the 8th century, that was the end of the story.
In the 11th century, however, a French poet would compose an epic poem that would turn this once-mentioned Roland into a national hero in a highly fictionalized re-telling of the Battle of Ronceveaux. Tomorrow we will have "story time." See you then.