Prepare the Potatoes and Onions:
Heat the olive oil in a large frying pan over medium heat. Add the sliced potatoes and onions, and cook gently, stirring occasionally, for 15–20 minutes until tender but not browned.
Drain and Cool:
Use a slotted spoon to transfer the potatoes and onions to a bowl, leaving the oil in the pan. Let them cool slightly.
Beat the Eggs:
In a large mixing bowl, whisk the eggs with salt and pepper. Add the cooked potatoes and onions to the eggs and mix gently until well coated.
Cook the Tortilla:
Heat a couple of tablespoons of the reserved oil in the frying pan over medium heat. Pour in the egg mixture, spreading it evenly. Cook for 6–8 minutes until the edges are set and the bottom is golden brown.
Flip the Tortilla:
Place a large plate over the pan and carefully invert the tortilla onto the plate. Slide it back into the pan, cooked side up, and cook for another 4–5 minutes until fully set.
Rest and Serve:
Transfer the tortilla to a plate and let it cool slightly before slicing into wedges.