Dirty brush
The dirty brush leaves bits of color on the tip, like the brushes you use with real paint. Instead of strokes in one flat color, you get a stroke with more texture and more variation.
The modes
The dirty brush has two modes:

Per stroke
The color changes on every stroke. Each time you press down and drag the pencil, you paint with a different color, within the range you picked.
Per stamp
A digital brush does not draw in one go: it lays down the shape of its tip many times in a row along the stroke. In this mode, the color changes on each one of those repetitions. If a stroke has 20 repetitions, the color will vary 20 times inside that same stroke.
Color range
This is the key of the dirty brush: the range of colors it can pick from.

Put another way: the range is the small palette the brush picks colors from at random.
The three controls (Hue, Sat and Lum) go from 0 to 80. At 0 there is no possible variation in that respect: the higher you take the value, the further the color strays from the one you chose.
Color pool size
This is the control that changes the result the most, and it sits right below the ranges.
The dirty brush does not pick between two colors: it pulls them out of a reserve. This control decides how many distinct colors sit in that reserve, from 4 to 153, with 8 by default.

A small pool gives very subtle variations, almost imperceptible but with a faint texture. A large pool gives a very marked variation, where the colors stand clearly apart from each other.
While you drag it, a grid preview shows you exactly the colors you are setting up, so you can adjust the number by looking at the result instead of guessing.
What it is actually for
The elements in a painting are rarely a single color. Vegetation, grass, wood or rocks are full of nuances and reflections, and all those variations are, underneath, color variations.
With the dirty brush you get them at random but controlled by the range you set. With subtle ranges, your paintings gain texture and stop looking flat.