Short answer
Patio comes from Spanish. In Spanish, patio first meant an open courtyard inside a house or other building. Portuguese has the same word, pátio, with a similar meaning. English borrowed the word in the early 19th century.
What the Spanish word meant
A Spanish patio was usually the courtyard at the center of a building. It was often open to the sky, with rooms opening onto it. That layout let light and air reach the surrounding rooms, and it gave the household a sheltered outdoor space inside the walls.
Where the Spanish word came from
The word is generally traced to Latin, most often to patere, “to lie open.” That is the same root behind English patent in its older sense of open or plainly visible. The exact route from Latin to Spanish is not fully settled, and other explanations have been proposed, so treat the Latin link as the most likely account rather than a proven one.
For the wider history, read the etymology of patio, which covers how the word moved into English and how its meaning changed.
How the Spanish origin shapes the modern meaning
Because the word started out as a courtyard, its early sense was an enclosed space within a building. Modern English uses it more loosely, for a flat, ground-level area beside a home. That shift matters when you compare project terms. A Spanish-style courtyard and a concrete slab may both be called a patio, but they are built differently.