a late Old English contraction of cyning "king, ruler" (also used as a title), from Proto-Germanic *kuningaz (source also of Dutch koning, Old Norse konungr, Danish konge, Old Saxon and Old High German kuning, Middle High German künic, German König).
This is of uncertain origin. It is possibly related to Old English cynn "family, race" (see kin), making a king originally a "leader of the people." Or perhaps it is from a related prehistoric Germanic word meaning "noble birth," making a king etymologically "one who descended from noble birth" (or "the descendant of a divine race"). The sociological and ideological implications render this a topic of much debate. "The exact notional relation of king with kin is undetermined, but the etymological relation is hardly to be doubted" [Century Dictionary].
General Germanic, but not attested in Gothic, where þiudans (cognate with Old English þeoden "chief of a tribe, ruler, prince, king") was used. Finnish kuningas "king," Old Church Slavonic kunegu "prince" (Russian knyaz, Bohemian knez), Lithuanian kunigas "clergyman" are forms of this word taken from Germanic. Meaning "one who has superiority in a certain field or class" is from late 14c.
As leon is the king of bestes. [John Gower, "Confessio Amantis," 1390]
In Old English, used for chiefs of Anglian and Saxon tribes or clans, of the heads of states they founded, and of the British and Danish chiefs they fought. The word acquired a more imposing quality with the rise of European nation-states, but then it was applied to tribal chiefs in Africa, Asia, North America. The chess piece is so called from c. 1400; the playing card from 1560s; the use in checkers/draughts is first recorded 1820. Three Kings for the Biblical Wise Men is from c. 1200.
[I]t was [Eugene] Field who haunted the declining years of Creston Clarke with his review of that actor's Lear. ... Said he, "Mr. Clarke played the King all the evening as though under constant fear that someone else was about to play the Ace." ["Theatre Magazine," January 1922]
king (n.) applied, at first in natural history, to species deemed remarkably big or dominant, such as king crab (1690s); the U.S. king snake (1737), which attacks other snakes and is regarded especially as the enemy of the rattlesnake; king cobra (1888). In marketing, king-size is from 1939, originally of cigarettes. A king-bolt (1825) was the large bolt connecting the fore part of a carriage with the fore-axle.
The King-snake is the longest of all other Snakes in these parts, but are not common; the Indians make Girdles and Sashes of their Skins, and it is reported by them, that they are not very venemous, and that no other Snake will meddle with them, which I suppose is the Reason that they are so fond of wearing their Skins about their Bodies as they do. [John Brickell, "The Natural History of North-Carolina," Dublin, 1737]
The modern use is mainly figurative and is perhaps from the word's use as synonym for king-bolt (itself from 1825), a large, thick, heavy bolt used in a machinery to couple large parts, but if this is the origin, the figurative use is attested earlier (1867) than the literal (1914).