Does dream lucidity come with understanding the mechanisms of the world, age, or something else?
I am unsure if you mean, if the ability to lucid dream comes with age? or if the type or degree of lucidity within the dream is different depending on the individual? So I will aim for a ballpark answer.
Lucid dreaming defined by a dream in which the dreamer is – while dreaming – aware that she/he is dreaming (Schredl & Erlacher, 2004).
A variety of different factors have been found to influence lucid dreaming. Though most people report having had a lucid dream at least once in their lives, only about 20% of the population reports having lucid dreams once amonth or more (Snyder & Gackenbach, 1988; in LaBerge, 1990).
Contrary to your suggestion, lucid dreaming has not been found to come with age, but rather is more common before the age of 16 (Voss & Frenzel, 2012). Additionally, much research has shown evidence supporting the idea that one can train oneself to lucid dream, hence suggesting that lucid dreaming does is not necessarily influenced by ones understanding of the world but rather is an acquired skill (see: Price & Cohen, 1988; LaBerge, 1980). However, it can perhaps be influenced by an individuals experience for example one study found a positive correlation between lucid dream instances and time spent playing video games (Gackenbach, 2006).
Gackenbach, J. (2006). Video game play and lucid dreams: Implications for the development of consciousness. Dreaming, 16(2), 96.