bitbindersQWERTY keyboards as they are called originate from type writers.
Type writers used to jam frequently when keys that were close to each other were typed in succession(together). Like if keys A and B were next to each other then typing BAT, BALL etc could cause jamming in type writer which slowed down typing by a huge extent.

Hence QWERTY keyboards were designed such that frequently occurring sequences such as ST (stump, stomp, stamp etc ) were far away from each other which helped typists speed up their typing by preventing jams. This tradition has continued to exist even now and we use it in keyboards of laptops and desktops.

How was the sequence of letters in a keyboard was decided?

“Christopher Latham Sholes” built the First typewriter in 1868. First designed model of this device had the letters and characters held at the end of a rod called the Type bar. When the keys were struck the type bar would swing up and hit the Ink coated tape which ll print the images on the paper.

The original design of the keyboard had all the keys in two rows in alphabetical orders. But what happened was when the mostly used combination letters of the alphabets like Th,St were hit one after the other the keys would Jam. The solution Sholes came up was to sparsely position the keys which had more combinations. This is when QWERTY was born.

The first of this device was made in 1874 by Remington & sons and it was called Remington 1. The second model Remington 2 brought in the Shift Key which enabled the users to type in both upper and lower cases.

Some more –
Why shift ?
The shift key was used to shift the Carriage position in order to type either the upper or lower cases which were on the same Type bar. The shift key we use today does not cause this mechanical action but the name remains unchanged.