Guess how Minecraft ticks? It's already in a loop, when the server gets launched, it gets into a snippet
while (this.serverRunning) { // this is the server
// This is where Minecraft server code happens, including running tick handlers' code every relevant tick depending on what they subscribed for, then it sleeps for at most 50 milliseconds before the loop goes on
}
This means that wherever you are in Minecraft, you are on a loop (one of 2 actually, one for server and one for client, but that's not the point). If a lot happens on the same tick, the game lags because the game loop doesn't go on.
Forge added tick handling events so mods can run their code on each relevant tick, if modders want to tick without pausing the game they start counting their ticks (on a global variable you still didn't make) and each time the tick counter reaches certain amount the mod runs its code.