The word "hok" or "hukah" appears regularly in Tanach and later writings. Often, the word clearly means regularity/constancy/periodicity, as in birkat halevana: חק וזמן נתן להם, שלא ישנו את תפקידם.
Chazal, discussing Parah Adumah, have a very different understanding of the word. According to them, a "hok" is a commandment whose rationale we do not understand, unlike many other commandments (i.e. murder, theft) for which the justification is clear.
How can we reconcile the idea that "hok" means regularity with Chazal's idea that "hok" means arbitrariness?
This question occurred to me upon reading Onkelus on Bamidbar 27:11. Onkelus translates "hukat mishpat" there as "gzerat din". Is this a literal translation? It's clear that "mishpat" and "din" mean pretty much the same thing. But "hukah" and "gzerah" sound like different things. "Gzerah" sounds like a royal DECREE, a perhaps arbitrary new requirement instituted by the king. In contrast, "hukah" sounds like a normal LAW, a timeless and socially necessary feature of the legal system. But Onkelus equates the two. In this, Onkelus is following Chazal's position that "hok" means arbitrariness – similar to the word "gzerah". But what about the sources in which "hok" clearly means regularity, not arbitrariness?
After pondering this a little, I came up with a linguistic theory which justifies Onkelus' translation and reconciles the two understandings of the word "hok". The words "hok" and "gzerah" may be based on roots with the same meaning. "Gzerah" comes from the root g.z.r, meaning "to cut". Similarly, "hok" and "hukah" may come from the root h.k.k, meaning "to inscribe". Both words testify to how ancient kings instituted new laws: they would inscribe them on large stone tablets and place them in public areas. Eventually, it seems, the verb "to cut/inscribe" was extended to mean "to institute a law" in both Hebrew and Aramaic. The law being instituted could be quite arbitrary, like in Chazal's understanding of a "hok".
In the end, it seems there are two different meanings to the work "hok" or "hukah". One meaning, usually represented by "hukah", means the same thing as "gzerah", like in Onkelus and Chazal. Linguistically, this derives from the fact that historically royal decrees were inscribed on stone tablets. The other meaning, usually represented by "hok", means something periodic and regular. This meaning derives from the fact that things "inscribed in stone" are predictable and not susceptible to change. Those qualities apply to planetary movement (birkat halevana), and to certain periodic customs and rituals.
In summary, the action of inscription in stone is an appropriate metaphor for two very different kinds of situations. Confusion occurs if we assume that the word "hok" in a verse is a metaphor for one of the two situations, when it's actually a metaphor for the other situation.