The association between yin-yang and qi as the totality of their relationship is an outgrowth of ancient Chinese nature religion (remember, natural harmony is seen as correlating with the well-ordered human society).
The search for the underlying principle (Dao) that governs nature later influenced the Chinese Buddhist search for ultimate peace through understanding the eternal Buddhist Dharma principles.
As we will discuss later, Buddhism probably had some influence on Daoism as well (= a synergistic relationship—both sides had an effect on each other).