The traditional interpretation as given by Han Feizi is that 公 is a compound of 八 (= 背 (“to deviate; opposite”)) and 厶 (original form of 私 (“individual; private”)), i.e. the opposite of “individual”; public. This theory is supported by Sun Yirang and Qiang Kaiyun, despite the somewhat different shape of the top component from 厶.
This is disputed in modern times by Gao Hongjin, who thinks that the 八 on top stands for 分 (“to divide; to distribute”) and the bottom round component of 口 symbolises the general object. 公 thus represents “equally dividing resources so that they are communal”.
Another theory put forth by Zhu Fangpu is that 公 is a pictogram (象形), being the original form of 瓮 (OC *qloːŋs, “a wide-mouthed round-bottomed jar”), and later borrowed for the meaning of “public”.
Possibly from Austroasiatic, compare Khmerឡូញ(louñ, “chief”) and [script needed] (klooɲ, “higher-ranking dignitary than louñ”). Compare also Proto-Tai*luŋᴬ(“parent's older brother”), whence Thaiลุง(lung) which is also borrowed from Mon-Khmer. Tibetan [script needed] (khoṅ) ~ [script needed] (goṅ) "final syllable in dignataries' name" may be borrowed from Chinese (ibid.).