How does modulus affect the regularity of language? the question is as follows, further the notation used are standard as used in theory of computation
$$L = \big\{ w : w \in \{a,b\}^*,\ |n(a) - n(b)| = 2k\}\,.$$ 

Beware 'K' is not a fixed integer its a set of natural number , so 2k means all natural nunbers divisible by 2 and so on for 3k , 4k... .I think the above language is irregular or its finite automata can't be formed. Firstly the above question in basic language can be thought of as modulus of difference of number of $a$ and number of $b$ is divisible by $2$ or is even , similar to this reasoning we can extend this to more general like $3k$, $4k$, $5k$,... and so on. Secondly we know that any condition which have comprise the difference between the symbols would have infinite possible comparison between symbols, like an equation of
 $n(a) - n(b) =0/1/2/3...$ needs infinite states of finite automata which makes them irregular.

But here with the use of modulus it seems no different as here also we will need many comparison between symbols. 

Thirdly its more of a general question like when define regularity of language $L$ over condition like,  $n(a) - n(b)\bmod 3 =0$, we say the all strings can be classified as having either remainder $0$,$1$,$2$ which by using Myhill-Nerode theorem proves the language regular. But why cant we use the same analogy over the relation like $n(a) -n(b)=2$ saying the all the strings would either have a difference $2$ or not. Further if you could answer the regularity of $n(a)- n(b) = 2k$, also how does taking modulus effect its regularity and how does it makes the states of finite automata finite which before applying modulus were infinite if you could a graphical representation would be appreciated.
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$.