The idea behind this matrix is very simple: it allows 5 different patterns from 0 to 4. Now for each position, you just check if the value is higher than the one mentioned in the matrix, then that position will be black. If the value is lower, then the pattern number then it is white. This gives us the following patterns:

I think you agree that the pattern moves slowly between fully black and fully white. Now all we have to do for our full color example, is change the white and black colors used here, into the lower and higher color value. This 2 by 2 matrix gives us a way to display 3 in-between levels, so this matrix can be used for the Green component. The zero pattern would be the lower color, patterns 1, 2 and 3 would be the in-between levels and 4 would be the higher color.

Now we know about the pattern, but we still don't know if a pixel should be the higher (lighter) or lower color (darker). To explain this, I will use some pseudo code. To draw a pixel at position x,y we do the following:

i = x modulo 2
j = y modulo 2

Modulo is just the remainder left after the division e.g. 10 modulo 2 is 0 (10 = 2 * 5 + 0) but 11 modulo 2 is 1 (11 = 2 * 5 + 1). Now lets take an example: suppose that a pixel should be drawn at x = 10 and y = 11 with an intensity of 2 (so between the two colors).

So we would get:

i = 10 modulo 2 = 0
j = 11 modulo 2 = 1

Now we will look up position [0,1] in the matrix ([0,0] is top right, just a convention). That is the matrix position with number 2. Now the 2 at that location should be compared with our wanted intensity (halfway between the 2 colors is pattern 2). Since the intensity is not larger (2 is not larger than 2) than that value, we will write the black pixel or lower (darker) color value. If our pixel's color was brighter, we might need pattern 3 (3 is larger than 2), and then we would have written the white pixel or the higher (lighter) color value.

Using this technique, we can determine for each and every pixel, whether it should be the darker or lighter value. All you need is a mod operation and a lookup/compare operation. Different matrices and thus patterns exist, but in the end, the results and technique is the same.