set /a limit=5
set /a loops=0
Sets %limit% = 5 and %loops% = 0
set /a loops=%loops%+1
Adds 1 to %loops%. If this is the first loop, it would be 0+1.
if %loops% EQU %limit% goto end
If the number %loops% = 5 goto end.
This means in every loop, %loops% will add 1 to itself and when %loops% equals 5, it will terminate. If not, it goes to :a