Fat provides energy in a compact amount. Standard food-energy factors are about 9 kcal per gram of fat and 4 kcal per gram of digestible carbohydrate or protein.
These factors explain a label calculation. They do not rank whole foods or set a personal target for how much to eat.