The names of the electron shells come from a fellow named Charles G. Barkla, a spectroscopist who studied the X-rays that are emitted by atoms when they are hit with high energy electrons. He noticed that atoms appeared to emit two types of X-rays. The two types of X-rays differed in energy and Barkla originally called the higher energy X-ray type A and the lower energy X-ray type B. He later arbitrarly renamed these two types K and L since he realized that the highest energy X-rays produced in his experiments might not be the highest energy X-ray possible. He wanted to make certain that there was room to add more discoveries without ending up with an alphabetical list of X-rays whose energies were mixed up.
As it turns out, the K type X-ray is the highest energy X-ray an atom can emit. It is produced when an electron in the innermost shell is knocked free and then recaptured. This innermost shell is now called the K-shell, after the label used for the X-ray. Barkla won the 1917 Nobel Prize for Physics for this work.