The mouse is a pointing input device; the successor to the light pen, and predecessor to the touch-pad. In addition to the abilty to point, almost all mice have had one or more buttons, to allow the user to signal the computer when some operation is desired.
The first mice were invented by Douglas Engelbart of the Augmentation Research Center at the Stanford Research Institute. They had two large wheels, with horizontal axes of rotation, with the axes at right angles to each other.
They worked, but were not very satisfactory; when the Xerox Alto project at Xerox PARC decided they wanted to use a mouse for a pointing device, Bill English (who had worked with Engelbart) came up with a design which used a ball to pick up motion, but it was still complex and expensive.
When Apple decided to add a mouse to the Apple Lisa, they called in a team at Hovey-Kelley Design, led by Dean Hovey, who produced the modern mouse: the ball is not supported by the mouse (as in the Xerox mouse), but simply rolls on the surface, and sensing shafts, held in contact with the ball by a spring-loaded wheel on the other side of the ball, turn slotted wheels which are monitored by optical sensors.
This design still had issues (it tended to pick up dirt), so eventually optical mice appeared, which sensed movement directly by reflecting light off the surface they were being moved over.