Excerpts from an article at Big Think:
The origin of the division goes back just over a century. In 1912, the U.S. federal government started licensing terrestrial radio stations, assigning the call letters W and K to stations in the east, respectively the west of the country...
Incidentally, radio call signs are reversed out on the ocean. Ship radios on America's Pacific coast start with W, and with K on the Atlantic side. It's unclear whether this practise, which precedes call signs for terrestrial radio, is the reverse by intention (i.e. to facilitate the distinction between radio stations on land and at sea) or, as some sources state, the result of miscommunication. ..
Quite early, the border between K Country and W Land had to be fixed geographically. But that dividing line lay further to the west than it does now... After January 1923, new radio stations in the switchover states would be assigned a K call initial rather than a W one. But a grandfather clause provided that those radio stations in those states which already had a W call sign could keep it. This explains some of the anomalous call signs still in existence today, if not quite all of them. There are currently 27 exceptions to the general K/W divide - 9 Ks in W Country, and 18 Ws in K Land. This map shows them all... Note that Louisiana and Minnesota are marked separately on the map: they are the only states bisected by the Mississippi, and call sign practice varies greatly as a result.