CSES - Even Outdegree Edges

I’m trying to understand the solution to this problem here Solution - Even Outdegree Edges (CSES). I have a question related to this part of the code:

            if (!visited[i]) {
                // visit it
			} else if (visited[node] > visited[i]) {
				// back edge
			}

I understand that this checks if the child node has a back edge to its ancestor. But I can’t understand why we check here if (visited[node] > visited[i])? I understand that if the child is already visited this means that this edge is a back edge all the time. So why do we use this check?
When I tried to remove the check here and make it just else I got WA. Please anyone explain this.

In general, if you are wondering why a solution doesn’t output the correct answer, please see How to Debug, as mentioned in How to ask for help on a problem - #2.

If a node i is visited, it doesn’t necessarily mean a back edge. The solution uses a timer variable, which marks when a node is visited. It’s possible for the vis[i] to be greater than vis[node], so you need that check there.