In order to stay beautiful, healthy and strong, hair must be provided with sufficient amounts of lipids. In plain English, lipids are: fats, oils and waxes (that are insoluble in water).
A number of lipids form necessary parts of a hair shaft. Others will come from nearby sebaceous glands.
Oils From Within
These may account to a figure up to 3% of the total oils involved. They are produced in the same place where hair color is produced (in the very same part of the cortex), and their goal is to provide a protective coating for the hair, which in turn prevents the absorption of too much water amongst other things.
Oils From Outside
The oils on the outside of a person's hair are produced by the sebaceous glands. Their place is right next to the hair follicle, and their function is to form a film on the surface of the skin which lubricates the hair. Bluntly put, they give the hair its flexibility and its shine.
The hormones are the regulators of lipid production. Different people's hormones handle this functionality of the human body differently, and this is why some people have greasy hair while others have dry.
People with greasy hair have an increased lipid production, and have to wash it more often because the grease itself attracts many kinds of dirt which then sticks to the hair.
To the contrary, people with a lower level of lipid production tend to have very dry hair and it is prone to becoming damaged more likely than the one of persons with greasy hair.
Applying hair oils should be a critical part of the "diet" of just about any given person's hair-maintenance habits. This involves massaging it with a choice or even a few of the many a variety of beneficial oils.
While choosing a brand, it is also important to trust a reliable one, since there are as many duplicates on the market as they may be harmful.
So with this said, it is crystal clear that having the right kind of diet simply doesn't provide for enough hair-maintenance. Still, harmful foods (those which are canned and processed) are not to be common indulgences if the person expects nothing but the most beautiful out of his or her hair.
On the other hand, fresh coconuts and olive oils seem to be as good as it gets when it comes to hair-maintenance.