Modular exponentiation, exponentiation performed over a modulus, a^x mod n, is cyclical, the same sequence of numbers is repeated in each cycle, similar to how going up one octave on a piano gets you to the same tone.
When the modulo is co-prime to the message, gcd(a,n) = 1, the sequence of numbers can be expressed with ax鈮(x mod 位(n)) (mod n). The sequence has 位(n) steps and the cyclical group can be illustrated with a simple diagram, shown below is the sequence for 5^x mod 7.
The definition often used for trapdoor one-way functions is a function that goes in one direction only, unless you have access to a secret key that reverses the function. That definition is a bit misleading, in RSA for example, the trapdoor does not really reverse f(x), instead it causes the exact same sequence of numbers to repeat in a higher cycle, it completes the function rather than reverses it.
The secret key in RSA is the exponent that together with the public key exponent reaches the base value again at a higher "octave". It is easy to compute if you know both prime factors of the public key modulo, because there is a short cut, 饾渾饾渾饾渾饾渾饾渾位(n) = 蠁(n) = n-1 when n is a prime number, so it is very easy to calculate if you know the prime factors, but hard to calculate otherwise.