Loops are a set of instructions in a compiler that execute a set of statements repeatedly until a condition becomes false. The basic purpose of a loop is to repeat code execution. Loops allow programmers to execute the same code multiple times without rewriting the code.