ONPG has a structure similar to lactose, so it can bind to the enzyme and be cleaved. The products are galactose and ortho-nitrophenolate; ortho-nitrophenolate is yellow in color and can be measured by spectrophotometry. Measuring the rate of an enzyme is tricky business.