A keyboard allows users to input text and commands into a computer by pressing keys that correspond to letters, numbers, and functions.