In a nutshell
Counting sort never compares values. It tallies how many times each possible value appears, adds the tallies up into running totals that say where each value belongs, then places every item directly into its final position. It's blazingly fast when the values come from a small range, but the extra memory grows with that range, not the number of items.