What kind of food components contain more energy?
The body can derive energy from three main "families" of molecules:


Fat. This is the highest density, at about 9 KCalories a gram. There are varying recommendations regarding the amount of fat intake to be healthy, and most major medical establishments have been seriously wrong over the past decades. In my opinion, which works for my body alone, 20% of your calories from fat is about right, but this varies from person to person. Fat is in any oil, fatty fruit (like avocadoes), margarine, animal fats and dairy products. The body can convert fat to glucose for energy as needed.
Carbohydrates. This includes sugars, and anything that breaks down into sugars, such as starches and complex carbohydrates. Glucose is a type of sugar that the body needs to burn for energy. Most starches will reduce to glucose via the body's own chemistry. Other simple sugars are metabolized differently, like fructose, which is too long a discussion for here. carbohydrates contain about 4 calories a gram.
Proteins. The body needs protein (a set of different amino acids) in order to build muscles, brain and other tissue. However, if needed or if there is an abundance of protein in the diet, the protein can be broken down to carbohydrates and waste products, thus gaining some energy from it, at about 4 calories a gram (like sugar).


From a health perspective, the body is "designed" to take the bulk of its energy from carbohydrates. Taking energy from protein is possible, but a high protein diet has a negative effect on the kidneys over long periods.

As for energy during the day, the release of energy (read glucose) into the bloodstream is governed by the time it takes the body to digest the sugar. The more fibre around the sugar (fruit, vegetables, whole grains etc.) the longer it takes to get to the sugar, and the slower the release. This allows for a relatively constant level of energy.

The opposite would be to eat some pure white sugar (or equivalent in candy or soft drinks). This causes the bloodstream to be flooded with sugar, giving an energy high. Within about 15 minutes, the body's insulin response will kick in and lower the sugar levels, causing a "down".