The episode refers to the fear that the Pisan soldiers showed, “temer li fanti”, in front of the numerous Florentine army, “veggendo sè tra nemici cotanti”, after negotiating their surrender in Caprona, “ch’uscivan patteggiati di Caprona”.
Here's what Villani (a historian from the first half of the 14th century) says about this enterprise:
“Nel detto anno 1289 del mese d’agosto, i Lucchesi feciono oste sopra la città di Pisa colla forza de’ Fiorentini, che v’andarono quattrocento cavalieri di cavallate, e duemila pedoni di Firenze, e la taglia di loro e dell’altre terre di parte guelfa di Toscana, e andarono insino alle porte di Pisa, a fecionvi i Lucchesi correre il palio per la loro festa di San Regolo, e guastarla intorno in venticinque dì che vi stettono ad oste, e presono il castello di Caprona, e guastarlo”.
(In the said year 1289 in the month of August, the people of Lucca fought against the city of Pisa with the force of the Florentines, who went there with four hundred cavalrymen and two thousand Florentine pawns, and the bounty of them and of the other lands of the Guelph part of Tuscany, and went as far as the gates of Pisa, to make the Lucchese run the palio for their feast of San Regolo, and spoil it around in twenty-five days that they stayed there as host, and took the castle of Caprona, and spoil it). (G. Villani. Croniche, VII, 137)
The fight for the Fortress of Caprona had begun in spring: it was first occupied by Nino Visconti -captain of the Pisan Guelph exiles and allied to Lucca - and then reconquered by Guido da Montefeltro. The Florentines were not ready to bring a fast backing up to the army of Lucca, as they were involved in a war with Arezzo. After defeating the Arezzo army at Campaldino(July 1289), they were able to divert part of their army and direct it towards Pisa's confines. The Poet was among the four hundred cavalrymen that allowed Nino Visconti to win back the Castle (August 16th) after a three day siege.