In addition to the 5 basic flavors, a bland taste is recognized. These herbs and foods tend to have the effect of being able to go places in the body where other tastes cannot go and of draining Dampness. Also, some authorities differentiate between sour and astringent instead of lumping both these tastes under sour. Sour-tasting herbs and foods tend to have heating energy and be moistening. Astringent herbs and foods tend to be cooling and drying. (These remarks about taste are general because there are exceptions.)
A food or herb can have more than one taste. For example, the herb Wu Wei Zi is prized because it contains all 5 tastes. In fact, its name translates as Five Flavor Seed. (The pharmaceutical name is Fructus Schizandrae. AKA schizandra.)
The Chinese idea of a balanced diet is one which includes all 5 tastes. But, the ratio of those tastes are going to vary according the the individual's needs and the season of the year. A person who is Yang Deficient is going to need a higher proportion of foods with Yang energy than other people do. These Yang energy foods will supply Yang energy s/he lacks and help the person obtain balance. On the other hand, a person who is Yin Deficient will need a higher proportion of foods with Yin energy. A person with Dampness problems needs to go easy on the foods and herbs with sweet, salty, and/or sour tastes because these tend to be moistening. A person with Dampness problems does not need an excessive amount of foods and herbs with moistening qualities adding to the Dampness. On the other hand, these foods and tastes can be great for some people suffering from Dryness. (There are exceptions. Everything is carefully tailored for the individual. You also still have to keep in mind if the person is too Hot or too Cold. Even though they all three tend to moisten, salty and sour tend to be heating, but sweet tends to be cooling. Sour tends to be more heating than salty so one really needs to watch out for sour in cases of Damp Heat. )
On the other hand, the foods with astringent, spicy, and bitter tastes can be great for people who are too Damp but good for people who are too Dry. Again, you also consider the thermal energy. The astringent herbs and foods tend to be cooling, the bitter herbs even more so than the astringent, and the spicy herbs and foods tend to be very heating.
From the preceding paragraphs, it's obvious that a large part of TCM is balancing opposites out. Balance Yang Deficiency with herbs and foods rich in Yang energy. Eat more Yang foods during the winter, the most Yin time of the year, and eat more Yin foods during the summer, the most Yang time of the year. But sometimes, it's appropriate to be in tune with the season - eating Yin foods during the winter and Yang foods during the summer. TCM is tailored to individual needs.
In general, meats tend to be Yang and veggies tend to be Yin. But the way food is prepared also affects the amount of Yang or Yin energy it has. Frying tends to increase Yang, and steaming tends to increase Yin. Thus, stir-fried veggies are more Yang than steamed veggies. A person who is Yang Deficient would tend to stir-fry the vegetables s/he eats whereas a person who is Yin Deficient would tend to benefit from eating more steamed veggies than stir-fried ones. Food which is served cooked and warm are more warming than foods which are raw and cold. For example, celery which is cooked in a stir-fried dish which is served warm is going to be more warming and more Yang than celery served raw in a cold salad.
In addition, certain tastes have an affinity for certain Organ systems in the body. For example, the salty taste has an affinity for the Kidneys (and Bladder). Sometimes dishes are salted in order to get the properties of the food to the Kidneys. It's also a common practice for a person who has certain Kidney imbalances to take a little salt along with herbal teas which are tonic to the Kidneys. Sour tends to have an affinity for the Liver and Gall Bladder. (Want to really watch this one in cases of gall stones or Damp Heat affecting the Liver.) Bitter has an affinity for the Heart and Small Intestine, spicy for the Lungs and Large Intestine, and sweet for the Spleen (aka Spleen-Pancreas) and Stomach. (Note: These are very, very general guidelines.)
There are no absolutely forbidden foods or "one size fits all" diets in TCM. Sometimes even sugar is included in an herbal formula because the person needs it. (This almost never happens in the U.S., but in other countries sugar can be a medicine for some individuals. It's so excessive in the U.S. that here it often is a "poison".)
Even in the West there aren't really any "one size fits all" diets, just people the mistaken belief that we're all the same - like interchangeable parts on a factory line. For example, salt is harmful for many people and will raise blood pressure in many individuals. These people will benefit from a low salt diet. But a low salt diet can have a devastating effect on people with adrenal insufficiency or Neurally Mediated Hypotension. Most people need to drink more water, but some people - like those with epilepsy - can be harmed by this practice (if they aren't very careful to eat something at the same time, even if it's just a cracker). Some people require more fat in the diet than others. Children in particular can develop health and growth problems when overzealous parents limit fat intake too much in their diets. Some people have greater than normal needs for certain vitamins or minerals because of genetics or because of an assault to their systems. A shortage of iodine can cause goiter, but too much can trigger some cases of hyperthyroidism. Etc.
But you can eat the wrong things at the wrong time and aggravate an existing condition.
Note: In TCM diet is considered the first line of defense in health matters. In some cases the person will have to straighten out the diet before the herbs can work properly or before the medicinal herbs are even given.