Analog mice are markedly simple devices, essentially motion sensors that perform vector addition to calculate a change in position. At the heart of a mouse you'll find ventricles and aortas... (sorry, wrong kind of mouse). At the heart of a computer mouse a rubber ball rubs against two or more rolling bars.
This ball is designed to be rather heavy, and have a high coefficient of static friction. These two attributes combine to form a ball that rolls instead of slides (heaviness increases normal force, and high coefficient of static friction increases the value for mu, multiply them together and one ends up with a high maximum static friction force). When the mouse is moved along a horizontal surface, the ball will roll underneath it.
This rolling is registered by two or more small cylinders within the mouse that are in contact with the ball. Because the radius of the cylinders and the radius of the ball is known, it is easy to figure out how far each roller has moved (essentially, how far the mouse has moved in each axis). The mouse then performs some form of vector addition of of this information (if there are just two rollers at ninety degrees to each other, it would be a simple Pythagorean identity, if there are three or more things get tougher).
The mouse then transmits these vectors to the computer via USB, and the computer moves the cursor on screen accordingly.