Why Removing Elements from an ArrayList While Iterating Causes Errors?

While working with ArrayList, I faced an issue when trying to remove elements inside a loop.