Why are the keys on a key board laid out the way they are?

A key board is laid out the same as a typer writer. http://en.wikipedia.org/wiki/QWERTY http://en.wikipedia.org/wiki/AZERTY