Hundun 混沌 was semantically extended from a mythic "primordial chaos; nebulous state of the universe before heaven and earth separated" to mean "unintelligible; chaotic; messy; mentally dense; innocent as a child".
In modern Written Chinese, hùndùn "primordial chaos" is 混沌, but Chinese classic texts wrote it either 渾沌—as in the Daoist classic Zhuangzi—or 渾敦 —as in the Zuozhuan. Hùn "chaos; muddled; confused" is written either hùn (混; 'abundantly flowing; turbid water; torrent; mix up/in; confuse; thoughtless; senseless') or hún (浑; 渾; 'sound of running water; muddy; muddled; confused; dull; stupid'). These two are interchangeable graphic variants readable as hún (混; 'muddy; dirty; filthy' [a]) and hùn 渾 "nebulous; stupid" (hùndùn 渾沌). Dùn ("dull; confused") is written either dùn (沌; 'dull; confused; stupid') or dūn (敦; 'thick; solid; generous; earnest; honest; sincere').
Isabelle Robinet outlines the etymological origins of hundun.