The reason dates back to the time of manual typewriters. When first invented , they had keys arranged in an alphabetical order, but people typed so fast that the mechanical character arms got tangled up. So the keys were randomly positioned to actually slow down typing and prevent key jams. The QWERTY keyboards were made so one could type using keys from the top row of the keyboard. This random arrangement became standard.

—Abhishek Parlikar, via email