The ultimate test of any computer software is whether it performs the intended task as expected. Loops are among the simplest operations in programming but the way to learn isn't to study what can go wrong, it's to clearly understand the problem you're trying to solve and correctly structure the code to make it do that.
Loops can hang the machine by never exiting the loop, they can exit before the task is complete, they can produce errors by over-running the maximum space allowed for array variables and they can produce erroneous data if not written properly.