Getting sick from Chinese food or water should be a real concern for western visitors. I, personally, was both stupid and lucky. By the time I left China, I had eaten a lot of street food and even raw fruits and vegetables, but I only got sick once. Abby, who lived across the hall, was very careful about where she ate and often cooked for herself. She got violently ill a couple times a month until we realized it was actually something on her cutting board that was contaminating her food. I also know people who never got sick because they never ate street food and peeled everything they ate.
Besides being in a new environment with a new set of bacteria that your body has not ever been exposed to, China also uses "dark soil" or "night soil." Basically this means the Chinese farmers dig out the latrine to fertilize their crops and so a serious set of diseases can be passed from person to populous. Another problem is that street vendors and some people in restaurants may or may not have the best hand hygiene, so even eating at a nice restaurant may cause problems. Diseases range from mild stomach and bowl problems, to dysentery, to hepatitis.
People visiting China for a brief period are usually fine. This is especially true for people on westernized tours that provides locations to eat and steer visitors to fancy sit down restaurants. A big problem with westernized tours is that they will serve westernized Chinese food, not the original thing! And much of the food is mass produced of low quality. It is, of course, tempting to leave this set of eating establishments. There are entire cuisines that you can get (cheaply) on the street corner, but not in a restaurant. All kinds of Chinese sweets or snacks are not sold in packages, but in pushcarts.
People staying in China for an extended period of time may want to consider bringing some serious antibiotics with them. If you are working in an area with a hospital and you get sick, you will receive the best care there is in China. And Chinese doctors have seen this all before and can diagnose and treat different ailments before a western doctor could diagnose them. However, using Chinese hospitals, especially outside large cities means you run the risk of being exposed to reused needles. If you will not have access to medical care, or even if you will but want to try to take care of yourself, talk to your doctor about bringing some antibiotics with you. Be sure you have instructions on when and how to use them, and even email or phone contact information if you are not sure about your symptoms. If you are living in China and plan on cooking for yourself, buy a bottle of bleach and sterilize everything you plan to cook and eat with. Be sure to peel all fruits and vegetables and boil any water you use in cooking for at least 7 minutes.
Let me emphasize that visiting China can be very clean and safe and many people (like my family and friends who visited) never get sick. But you should be careful. Avoid raw or unpeeled fruits and vegetables and any contact with unsterilized water. It is also important to avoid unpasturized milk products since milk products can carry TB. If you want to play it safe, stay on the westernized tour circuit and ask for restaurant recommendations from your tour guide or hotel. It is also safe to eat food that is prepackaged such as juice, soda, crackers, instant foods, and dried fruit. These sorts of snacks are available on virtually every street corner. Be sure your hands are clean and be sure to clean any place you put your mouth on the packaging (like on soda cans).
If you want to try the street food (and it is _very_ tasty), consider only eating hot foods that come directly out of the pot, vat, or steamer. Street foods are usually sold by the piece (meat on a stick or steamed buns) or by weight (roasted seeds) and generally at a fixed price. By using hand signals, it is easy for people without any Chinese language background to buy street food. Buying food in a restaurant can me more problematic if you do not know Chinese, but a good Chinese dictionary (with characters) or just pointing at the dishes served to other patrons can get an excellent meal on your table.