Why can you reverse a modulo function when knowing its primes We are dealing with cryptography in school right now and superficially went over the Rabin cryptosystem with the (apparently usual) example of p=7 and q=11 etc (we didn't do RSA).

I understand that there are many results when you try to reverse $15 = m^2 \pmod{77}$. E.g. $m^2 = 77+15, 77*2+15,77*3+15$ and so on.

What I don't understand is how it gets easier to reverse this function when you know the primes that you used to calculate the divisor (/the thing with which you did the modulo operation)?

Is this advanced mathematics or is it really quite easy, because for me whether I write $15 = m^2 \pmod{77}$ or $15 = m^2 \pmod{(7*11)}$ doesn't really matter, they're both the same equations.

Of course it apparently matters, so that is why I'm asking.
What i don't understand is how it gets easier to reverse this function when you know the primes that you used to calculate the divisor


Well, we know how to compute square roots modulo a prime; that is, how to solve the problem $a \equiv x^2 \pmod p$, for prime $p$ (assuming, of course, if there is a solution; there might not be one).

In addition, if we know the solution to $a \equiv x^2 \pmod p$ and we know the solution to $a \equiv x^2 \pmod q$, then we know the solution to $a \equiv x^2 \pmod{lcm(p,q)}$ (which is $a \equiv x^2 \pmod{pq}$ if $p$ and $q$ are relatively prime.

What this means that if we know the complete factorization of $n$, then we can solve $a \equiv x^2 \pmod n$ (by looking at each prime factor $p$ of $n$, solving $a \equiv x^2 \pmod p$, and then combining all the answers).  (Actually, I haven't gone into what you would do if $n$ had a factor $p^2$, however that isn't that much more difficult).

With that said, what if you don't know the factorization of $n$; how can you solve $a \equiv x^2 \pmod{n}$?  Well, if $n$ is large (that is, large enough to make factorization impractical), then that looks like a hard problem.  In fact, if you could solve that problem, it turns out you can factor $n$ (by selecting a random $r$, and then trying to solve $r^2 \equiv x^2 \pmod{n}$.  It turns out for composite (more specifically, has at least 2 prime factors) $n$ that there are (at least) four possible answers, and for at least half the answers $s$, $gcd(n, r-s)$ is a nontrivial factor, so that has a good probability of yielding a factor.  Hence, if we have a way to solve this equation modulo a composite, this gives us an efficient way to factor that composite.

So, if we assume factoring is a hard problem, so is computing square roots modulo a composite.