Love’s Labor’s Lost is set in the Kingdom of Navarre, a real kingdom that existed in northern Spain on its border with France. Its geography meant that this kingdom had a complex history, as various French and Spanish rulers laid claim to parts of it throughout the Middle Ages and the Renaissance. The kingdom was split, and many parts of it were incorporated either into Spain or France by 1589. King Henry III of Navarre, a possible rough prototype for Ferdinand, joined northern Navarre with France in 1589 and ruled them both as a unified kingdom.
While this kingdom provided a basis for the world of the play, Shakespeare freely embellishes the setting to suit his creative vision. While the real life leaders of Navarre would have certainly had to meet French royalty, the story is entirely Shakespeare’s own invention.
Though the majority of Shakespeare’s plays are set outside of England, this is the only play across his oeuvre set in Spain. There is no clear reason for this (Shakespeare was not well-traveled, so he had no personal relationship to Spain). The play was written in the 1590s (probably close to the midpoint in this decade). The action of the story can be considered more or less contemporaneous. Though it borrows Navarre’s name and location, Ferdinand’s court is more Shakespeare’s invention than any comment on Spain at the time.