The two parts of Don Quixote were not written in quite the same country: when the first part was written it was legal for a Moor to live in Spain; by the time the second part was written it was not. Chronic tension between the two ethnic groups, worsened by economic pressure, culminated in a series of royal decrees ordering that all remaining 'moriscos' be banished permanently. The process was systematically carried out between 1609 and 1614, the exiles permitted to keep only what possessions they could carry with them.
The change is reflected in the book: while in Part I a morisco is hired to translate Cide Hamete's manuscript, and the captive Ruy Pérez de Viedma is able to return home with the beautiful Algerian Zoraida practically as his fiancée, here Sancho's friend Riconte must sneak back into his homeland in disguise. Cervantes allows him to muse poignantly on the grief of being treated as foreign in the land of one's birth, and even contrives a happy ending in which he reclaims the property he hid from the government, and is reunited with his daughter. However, this is accompanied by his repeated humble ackowledgments of the general evils of his race, and praise for the wisdom of the King's decision.