The origin of the yin yang symbol is found in the ancient Chinese time-keeping system of using a pole to measure the changing lengths of shadows over the solar year;
This system was invented in China at least as long ago as 600 BCE. Yang begins at the winter solstice and indicates the beginning of the period when daylight dominates over darkness and thus is associated with the sun. The yin begins at the summer solstice and represents the dominance of darkness over daylight and is associated with the moon.
Yin-yang also represents the observation of the shadow of the earth on the moon, and the record of the position of the Big Dipper constellation through the year. These observations make up the four points of the compass: the sun rises in the east and sets in the west, the direction of the shortest shadow measured is south, and at night, the pole star points north. Thus Yin and Yang are fundamentally connected with the annual cycle of the Earth around the sun and the resulting four seasons.
Pictured: The "cycle of Cathay" as depicted by William Alexander Parsons Martin.
The resulting philosophical concept describes opposite forces which are interconnected. In Chinese cosmology, the universe creates itself out of a primary chaos of material energy, organized into the cycles of yin and yang and formed into objects and lives. Yin is the receptive and yang the active principle.
The philosophy is at least 3500 years old, discussed in the ninth century BCE text known as the I ching or Book of Changes, and influences the philosophies of Taoism and Confucianism.
Pictured: Joseon folk painting depicting a Yin Yang inside I ching trigrams, also called Pakua.