The Khitan are part of the big group of Turkic and Altaic language speakers from Central Asia who gradually got more and more power during the Middle Ages. By 300 AD, the Khitan were already living in the eastern part of Central Asia, north of China. Like other northern Asian people, they rode horses, kept herds of cattle, fished, and hunted. During the Early Middle Ages, the Khitan lived in between two more powerful groups: first the Gokturks and then (after 742 AD) the Uighurs to their west and China to their south. Khitan soldiers fought as mercenaries for both the Uighurs and the Chinese. But like other mercenaries in other places about the same time, the Khitan slowly learned more about their employers, and began to think about getting some power themselves.
So when the Uighur empire collapsed in 841 and the T’ang Dynasty collapsed about 900 AD, the Khitan were ready to jump into power. In 907 AD the Khitan renamed themselves the Liao Dynasty, and they gradually conquered south and west, taking over old Chinese and Uighur land. As the Liao Dynasty, the Khitan forced the Chinese Sung Dynasty to pay them lots of gold every year as tribute. The Khitan got rich and learned to write Chinese (or bought Chinese slaves who could write). The Khitan also developed their own writing system, though nobody really knows how to read it anymore. Just like many people in China at the same time, most Khitan people now converted to Buddhism.
As was usual in Central Asia, many of the Khitan rulers were women. When the khan Yelu Dashi died in 1143, his wife Xiao Tabuyan ruled as regent for their son. After their son, Yelu Yiliu, died in 1163, his sister Yelu Pusuwan ruled the Khitan. But to the east, the Mongols were already conquering the Jurchen and expanding their empire. By 1220 the Khitan became part of the Mongol Empire.
Bibiography and further reading about the Khitan: