The device sends a series of digital pulses to the computer which indicate things like duration of pulse, direction of movement of the object being manipulated, etc.
A very naive view of a digital device could be a wheel which opens and shuts a switch each time it rotates. Each full turn would then send an open-close pulse which a computer could read. By having more than one switch, the direction of rotation could be determined, 2-D movement could be determined, etc.
This would enable the computer to work out how fast the wheel was turned (time between pulses), what direction (compute pulse rates in both X and Y direction) and how far the wheel was turned (how many pulses).
Devices such as the Mouse and Trackball operate on this principle.