According to the Taode jing, something existed "before heaven and earth" and the author, not knowing the name of that something, called it Tao (Ch. 25). This Tao is a very different Tao from the tao discussed as "the way," and it is a later use of the term. The Taode jing uses the term in both ways (and several others). To distinguish them, this article will capitalize the Tao of cosmology. This Tao is said to be the primordial "stuff" from which all matter emerges.
From Tao a primal matrix of energy spontaneously occurred, existing then for eons in a state of chaos known as hundun. Within this matrix are the qi, the cosmic breaths that animate the universe, but at this point the qi are undifferentiated and exist only as potential energies. At a certain point, for unknown reasons, the qi are released. Some are light (yang), and travel upward to the heavens, some are heavy (yin), and travel down to earth. Between these is a point of connection, the center between the heavens and earth, which is equally important. From these three emerges all of existence, described as the "myriad things," or the "ten thousand things."
Once Tao enters into existence, it takes on yet another meaning; it is the natural patterns and cycles of the cosmic and earthly order. All natural phenomena are generated by the alternation between yin and yang energies. Matter ebbs and flows, expands and contracts. The cycle of existence spontaneously moves through each of the Five Phases: Water, Fire, Wood, Metal, and Earth. All things are thus classified according to yin/yang and the Five Phases (sometimes called the Five Agents or the Five Elements). Within everything there is also qi, the animating breath that is the source of life.
Tao is not an entity or a divine being. There are no divine beings that existed before this initial moment of creation, but the number of Taoist deities is staggering. The pantheon differs according to sect and region, and its ranks are fluid. No divine being exists forever, and all who interact with humans are subject to human time. Some change over time, and all of them change status with time. Some are elevated, others forgotten.
In the early days of Taoist religion, deities that preexisted Taoism continued to be important to the Taoist religion, such as Xiwangmu, the Queen Mother of the West, and her consort, the King Father of the East. She resides on the sacred mountain, Kunlun, is able to teach and confer immortality, and remains a popular Chinese deity today. Another significant early deity who carried over into Taoism was Taiyi, the Great Unity or the Supreme One. In Shangqing Taoism he is regarded as the deity who resides in the Great Dipper and built and unified the Nine Palaces of Heaven.
The Yellow Emperor, or Huangdi, was an important figure for Huanglao Taoism; Huangdi, who became popular during the Han dynasty, was said to have ruled China during the 3rd millennium B.C.E. To him were attributed several texts concerning immortality, and some also credited him with the creation of humanity and the invention of writing, the compass, the pottery wheel, the breeding of silkworms, and many other essential elements of human culture. The Jade Emperor is another Taoist deity who, like the Yellow Emperor, was said to have created humanity; he remains very popular today.
With the Way of the Celestial Masters, Laozi became a principle deity, and he continues to be the personification of Tao for many Taoists. He is usually regarded as one of the Three Pure Ones, along with the Celestial Worthy of Primordial Beginning, the Celestial Worthy of Numinous Treasure. There are also the three Officials, the Emperor of the South Pole and Long Life, the Emperors of the Thirty-two Heavens, the Emperor of Purple Tenuity and the Northern Pole, and many, many more. All of these deities are divine emanations of celestial energy, pure cosmic qi, and have emerged from primordial chaos.
Taoist immortals are another kind of divine being, and a third type are the ancestors. Only those who die a natural death at the end of a completed life cycle can become ancestors, who then may act as benefactors to the living members of the family. Ancestors can also judge, however, and they may cause trouble for the living who do not act as the ancestors expect them to act.