How does modulus affect the regularity of language?
You seem to be assuming that, to determine whether $n(a)-n(b)$ is a multiple of $m$ requires us to computer $n(a)$ and $n(b)$, subtract them, and then calculate the remainder. You're correct that a finite automaton can't do that, but it's not the only way.

The first thing to note is that you can computer $n(a)-n(b)$ directly. Initially, you've seen no $a$s or $b$s so the difference is zero. Each time you see an&nbsp;$a$, the difference increases by one; each time you see a&nbsp;$b$, the difference decreases by one. OK, that's a bit smarter but it still requires us to compute the value $n(a)-n(b)$, which could still be arbitrarily big, so still can't be done with a finite automaton.

The second thing to note is that, because of the way that modular arithmetic works,
$$(x-y)\bmod m = ((x\bmod m) - (y\bmod m)) \bmod m\,.$$
In other words, you can do everything modulo&nbsp;$m$. Each time you read an&nbsp;$a$, the difference increases by one modulo&nbsp;$m$. and each time you read a&nbsp;$b$, it decreases by one modulo&nbsp;$m$.

This means that you can recognize the language with an automaton with $m$ states: one for each value of $n(a)-n(b)\bmod m$.