Heat the olive oil in a large frying pan over medium heat.
Add the thinly sliced potatoes and onions to the pan. Cook, stirring occasionally, until the potatoes are tender but not browned, about 15-20 minutes.
Use a slotted spoon to transfer the potatoes and onions to a bowl. Reserve the oil.
In a large bowl, beat the eggs and season with salt and pepper to taste.
Gently fold the cooked potatoes and onions into the beaten eggs, making sure they are well coated with the egg mixture.
Heat a few tablespoons of the reserved olive oil in the frying pan over medium heat.
Pour the egg, potato, and onion mixture into the pan, spreading it out evenly.
Cook on medium-low heat until the edges start to set, about 5-7 minutes. Gently shake the pan occasionally to prevent sticking.
Place a large plate over the frying pan and carefully invert the tortilla onto the plate.
Add a bit more of the reserved oil to the pan if needed, then slide the tortilla back into the pan, uncooked side down.
Cook for another 5 minutes, or until the tortilla is fully set and cooked through.
Let the tortilla cool slightly before slicing it into wedges.
Tortilla Española can be served warm or at room temperature, often accompanied by a simple green salad or as part of a tapas spread.
Enjoy your meal!