I have known it since when I was in the primary school. However, I did not get its underlying insight until now, although it is simple.
First, a brief description of the algorithm: Input, (a,b) Output: g, the greatest common divisor.
1) M<-a, N<-b, Divide M by N, suppose the remainder is r.
2) If r==0, return N.
3) else, M<-N, N<-r, repeat the process of 1.
The step 1 and 3 give the relation that M=q*N+r.
If a divisor is for M and N, then it is also a divisor for M-qN=r. (basic rule of division)
In the other direction, if a divisor is for N, and r, then, it is also for N and N*q +r=M.
So, the above two rules say, a divisor is for M and N <=> it is a divisor for N and r. (invariant of the recursion)
Therefore, instead of computing the divisor of M and N, we can compute the divisor of a pair of smaller numbers N and r.
The proof for why the number returned by step 2 is the greatest divisor is as follows.
Suppose the second last step is M=q'N+r. and the last step is N=q''r, accordingly (for consistent reference of the variables, we do not replace them as in step 3).
Clearly, r is the common divisor of N, r,and then M. Therefore, by recursion, it is a common divisor of a and b. As r is a common divisor, it is a divisor of g, i.e., r<=g.
For the greatest common divisor, g, it is divisor of a and b, then recursively, it is a divisor of M and N, and r. We see, r>=g.
Combining the above two relations, r=g.