Peel the potatoes and slice them thinly (about 1/8 inch thick).
Peel and slice the onion thinly.
Heat the olive oil in the frying pan over medium heat. Add the sliced potatoes and onions, seasoning with salt and pepper. Cook gently for about 15 minutes, stirring occasionally, until the potatoes are tender (not browned).
Once cooked, drain the excess oil from the pan and transfer the potato and onion mixture to a mixing bowl. Allow it to cool slightly.
In the same bowl, beat the eggs and season with a pinch of salt. Add the cooled potato and onion mixture to the eggs, stirring gently to combine.
Return the frying pan to the heat, adding a little more olive oil if necessary. Pour the egg, potato, and onion mixture into the pan, spreading it out evenly.
Cook for about 5 minutes on medium heat until the bottom is set. Use a spatula to check for browning.
Carefully flip the tortilla by placing a large plate over the pan, inverting it, and then sliding the tortilla back into the pan to cook the other side for another 5-7 minutes until golden brown and cooked through.
Once cooked, slide the tortilla onto a serving plate. Allow it to cool for a few minutes before slicing into wedges.
Serve the Spanish Tortilla warm or at room temperature.