From what I understand, your body needs certain amounts of vitamins and minerals to maintain health. Why can't we just take enough pills to obtain these vitamins and minerals?
This is more of a biochemistry question and to be honest its a little bit out of my league because I have not had the necessary grad classes to explain nutrition but indeed I will try.
Unknown metabolite cofactors and things like ionization, oxidation and state of matter are the reason that straight up vitamins are rejected by the body and cause really expensive urine and a difficult time otherwise excreting.
Metabolism involves a vast array of chemical reactions, but most fall under a few basic types of reactions that involve the transfer of functional groups. This common chemistry allows cells to use a small set of metabolic intermediates to carry chemical groups between different reactions. These group-transfer intermediates are the loosely bound organic cofactors, often called coenzymes.
Each class of group-transfer reaction is carried out by a particular cofactor, which is the substrate for a set of enzymes that produce it, and a set of enzymes that consume it. An example of this are the dehydrogenases that use nicotinamide adenine dinucleotide (NAD+) as a cofactor. Here, hundreds of separate types of enzymes remove electrons from their substrates and reduce NAD+ to NADH. This reduced cofactor is then a substrate for any of the reductases in the cell that require electrons to reduce their substrates.
Therefore, these cofactors are continuously recycled as part of metabolism. As an example, the total quantity of ATP in the human body is about 0.1 mole. This ATP is constantly being broken down into ADP, and then converted back into ATP. Thus, at any given time, the total amount of ATP + ADP remains fairly constant. The energy used by human cells requires the hydrolysis of 100 to 150 moles of ATP daily, which is around 50 to 75 kg. In typical situations, humans use up their body weight of ATP over the course of the day. This means that each ATP molecule is recycled 1000 to 1500 times daily.
If you did not like that explanation of cofactors maybe you will this:
Whole foods offer three main benefits over dietary supplements:
Greater nutrition. Whole foods are complex, containing a variety of the micronutrients your body needs — not just one. An orange, for example, provides vitamin C plus some beta carotene, calcium and other nutrients. A vitamin C supplement lacks these other micronutrients.
Essential fiber. Whole foods, such as whole grains, fruits, vegetables and legumes, provide dietary fiber. Most high-fiber foods are also packed with other essential nutrients. Fiber, as part of a healthy diet, can help prevent certain diseases, such as type 2 diabetes and heart disease, and it can also help manage constipation.
Protective substances. Whole foods contain other substances important for good health. Fruits and vegetables, for example, contain naturally occurring substances called phytochemicals, which may help protect you against cancer, heart disease, diabetes and high blood pressure. Many are also good sources of antioxidants — substances that slow down oxidation, a natural process that leads to cell and tissue damage.
I think the piece of missing information here is the distinction between macronutrients and micronutrients. The info from Mayo clinic quoted in the another answer addresses some reasons why whole foods might be better than pills for obtaining micronutrients (i.e. vitamins and minerals). While this may be true, most of it remains to be conclusively demonstrated (arguably). However, one clear reason “why….you need a healthy diet on top of that” is (unarguably) to obtain the fat, protein, and carbohydrates that your body uses to create energy. Unlike the minerals that act as cofactors, these macronutrients are the substrate. They are broken down to create the ATP that keeps everything running and they are built up to create the very structure of the body.
The energy that is consumed in the form of food or drinks can either be stored in the body in the form of fat (the major energy store), glycogen (short-term energy/carbohydrate reserves), or protein. . . to be used by the body to fuel energy-requiring events. *
These are called macronutrients because they are required in gram quantities — hundreds or even thousands of times more massive than the requirements for most micronutrients. As such, they don’t fit in a pill. As tragic as it is, we must keep eating.
*Gibney, M. J., & Nutrition Society. (2009). Introduction to Human Nutrition. Chichester, West Sussex, U.K.: Wiley-Blackwell.
The Question: Why can't we just take enough pills to obtain these vitamins and minerals?
We don't know enough about nutrition.
There are about 45 essential nutrients, which you need to consume to be healthy and live. You can get all of them from food without thinking about them. I'm not sure if currently there are a lot of supplements on the market that contain all essential nutrients. Also, we may currently still not know which all nutrients are essential, so we may miss some when designing multivitamin/mineral pills.
Food is easier!
A healthy adult who regularly consumes both plant and animal foods in reasonable variety and amount does not really need any vitamin/mineral supplements. And you need to eat foods to get calories. Yes, you could make supplements to substitute calorific content; imagine some sort of carbohydrate powder. But why complicate this when food is readily available, much cheaper, and easier?
TL;DR : Food gives the human body much more than simply vitamins & minerals. A healthy diet is essential to overall healthiness, not just this one aspect of it.
The component you're asking about - vitamins & minerals - are referred to as "micronutrients", and is only a quarter or so of what the body needs. Micronutrients are the vitamins like Vitamin A, Vitamin B, Vitamin C, etc. but it's also trace elements like zinc, iron, iodine, and many other metals that the body requires in very small quantities.
This is the part of the diet that most people actually overlook, and is what pills like the "once-a-day" vitamin are intended to supplement.
Much of what we get from food falls in the category of "macronutrients". These nutrients are the actual building blocks of the body - things like fats, proteins, calcium, carbon, hydrogen, etc. A lot of macronutrients are required on a daily basis, and it would be difficult to condense these into a pill form. An average-sized pill would have to be taken 5-6 times a day in order to provide even a less-than-average amount of macronutrients for the average person.
The human body is designed to be an engine. The act of eating is hard-coded into human physiology, and the act of digesting food kick-starts a great many processes throughout the body. Digestion is a rather efficient process, and it's one that only works properly when it has enough food to break down. A handful of pills could never fuel this process correctly, since they would simply dissolve in the stomach and never require any kind of breaking down.
Lastly, food & drink have a psychological component to them as well. The human brain is wired so that it desires food on a psychological level. The physical act of eating something soothes that desire in a way that a pill never could. One of the greatest obstacles to someone trying to lose weight is this very component - even when their body technically has what it needs from vitamins, supplements, or shakes, this psychological aspect of hunger makes them want food anyway.