Grayscale and black and white are different
Grayscale replaces each pixel’s colour with its brightness and keeps all 256 levels of grey. That is what most people mean by a black and white photo. Pure black and white keeps only two values: every pixel becomes black or white. That suits line art, signatures, stencils, laser engraving and printing on thermal or one-colour printers.
How brightness is calculated
A simple average of red, green and blue makes greens too dark and blues too light, because the eye is far more sensitive to green. This tool uses the Rec. 709 weights: 0.2126 × red + 0.7152 × green + 0.0722 × blue, applied to the image’s stored sRGB values. A pure green becomes a light grey (182 of 255); a pure blue becomes nearly black (18).
Threshold and dithering
With a threshold, every pixel at least that bright turns white and the rest turn black. 128 is the middle; lower it to keep more white and raise it for more black. Without dithering, gradients become flat areas with hard edges. Floyd–Steinberg dithering carries each pixel’s rounding error forward to its neighbours (7/16 to the right, 3/16, 5/16 and 1/16 to the row below), so a mid grey becomes an even pattern of black and white dots that reads as grey from a distance.