Principle explanation
The mathematical concept involved here is winding number, which refers to a topological invariant when two closed curve