This video from 3blue1brown is a mathematical analysis of The Print Gallery. It is 45 minutes long and goes into some complex geometrical transformations, but it gives an elegant explanation for the looping and scaling.
https://youtu.be/ldxFjLJ3rVY?si=hdLPgNlDV8JrcaFw