Many OMR devices have a scanner that shines a light onto a form. The device then looks at the contrasting reflectivity of the light at certain positions on the form. It will detect the black marks because they reflect less light than the blank areas on the form.