The energy content of an average carbohydrate

Describe the differences in the energy content of an average carbohydrate compared to an average protein and an average fat. They each play an important part of the diet, why?