@evinda The counts of $0$ and $1$ are swapped. With that corrected, it means the array contains no element $\equiv 0 \pmod{4}$, one element $\equiv 1 \pmod{4}$, one $\equiv 2 \pmod{4}$ and two elements $\equiv 3 \pmod{4}$. The condition $\equiv k \pmod{4}$ is another way to express that the last (lowest order) digit of the number in base $4$ is $k$.
@evinda It's probably a good idea to write the numbers in base $4$, using two digits for each (that means, a leading zero for numbers $< 4$). We have $15 = 33_4,\, 7 = 13_4,\, 14 = 32_4,\, 1 = 01_4$.
@evinda Actually, first count looks 0,1,1,2, and after the loop count[m] = count[m] + count[m-1] we get count as 0,1,2,4, not 0,1,2,3. At that point, count[m] contains the number of array elements whose last digit is $\leqslant m$.
And that is - I assume $0$-based arrays - one more than the last index where a number with last digit $m$ shall be put in the B array.
@DanielFischer So is it random that the first array contains at the $m$th position the number of numbers that are equivalent to $m \pmod 4$ and the second contains at the $m$th position the number of numbers of which the last digit is $\leq m$ ? :/
@evinda Absolutely not. It's what makes the algorithm work. When we fill that intermediate array B, we must know where to put each element of the original array when we encounter it. For that, we must know how many elements will eventually be placed before it.
@evinda To determine where each array element will be placed, we count how many elements have last digit $k$ - for all possible values of $k$ - and then add them up to know at which position the last number in the array with last digit $k$ shall be placed.