In 1500 AD, most people in China prayed to their traditional gods. The most accepted philosophy was Taoism. But many other people were Buddhists, and rejected Taoism. Because of the Mongol Empire and the Silk Road, more and more people in China were Muslims, as well.
In the 1540s, the Ming Dynasty Emperor Jiajing, who was a Taoist, persecuted Buddhists.
In 1911, the government of Sun-Yat Sen took over China. Sun-Yat Sen and Chiang Kai-Shek were Chinese Christians, but before Christianity gained much ground in China, Mao Zedong came to power, and his Communism was atheistic. Officially Chinese Communists have no religious faith. Chinese troops destroyed many Buddhist monasteries and temples to Chinese gods.
By the year 2000, about two out of three people in China were atheists, not following any religion. Most of these follow the teachings of Confucius, and still do worship their ancestors as he recommends. But today the official atheism is more relaxed, and some people do openly practice religion. Most of the people who follow a religion are Buddhists or Taoists, with just a few Jews, Muslims, Christians and Falun Gong. The Chinese government hassles all of these religious minorities, especially the Falun Gong.