A mouse wheel has many 'pits' in them, or straight through, cut rectangular gaps (such as the gaps between spokes of a bicycle wheel). Movements of a mouse wheel are detected in the same way as cursor movement is detected in a conventional mechanical mouse, as Howstuffworks explains.
What happens is that a transmitter and sensor is positioned on either side, aligned directly parallel to the sides of the mouse wheel. The infrared transmitter emits an infrared ray accross and through the pits of the mouse wheel, and are then detected by the infrared sensor. Also, the solid sections of the mouse wheel between the gaps (imagine the solid metal spokes of a bicycle wheel), block infrared rays to the sensor. Therefore, when the mouse wheel is rotated, the mouse can detect the amout of scrolls that are achieved by the user, and then converts it into electrical signals bla bla bla...till the page on your monitor scrolls down. Simple really
. Mouse wheels in both optical, laser, and the conventional mechanical mouse all use infrared arrays.
As Howstuffworks explains, Infrared sensors are also used in conjuction with the mouse ball, of mehcanical mice, for coordinating cursor movement. Two infrared arrays are position on opposite sides of a pitted plastic disc, which is attatched to the end of two cylindrical rods (you can see them touching the mouse ball underneeth your mouse). The movement of the mouse rotates the mouse ball, which then rotates the two rods accordingly. They then spin to alternate the blocking and detecting of infrared rays.
Hope this helps!