The Compare texture lets you use a logical comparison operator as a way to combine textures. The node takes four inputs. The first two inputs are the textures to compare. The second two inputs are the comparison results.
In Figure 1, Input A is a Noise texture, and Input B is a Gradient texture whose mapping is based on a Falloff texture. The Compare texture looks at the color values of A and B. When the color values of A is less than B, a green RGB texture is mapped to the surface. When the the color values of A is equal or greater than the color values of B, a red RGB texture is mapped to the surface. You can create very complex textures using the Compare texture when you combine them with other Compare textures.
Figure 1: The Compare node used to mix red and green RGB nodes together
Figure 2: Compare node network