A fat is one of the three categories of macronutrient, along with carbohydrate and protein. A fat can also be called a lipid. Fats from vegetable sources are usually liquid at room temperature, while fats from animal sources are usually solid at room temperature, although exceptions exist.
"Fat" is a very old, plain English word, and it is perhaps an unfortunate accident of language that a word with the colloquial meaning of "obese" or "large" has a fairly technical meaning.
All life that we commonly encounter stores or uses energy in the form of carbon chains. Plants produce these carbon chains out of solar radiation and carbon dioxide. Both plants and animals combine molecular oxygen in the atmosphere with carbon chains to create usable energy.
Since our cells are filled with water, the main molecules that is used for making energy are various sugars. Sugars are water soluble, which means a sugar molecule can travel easily through both the cytosol inside a cell and through the bloodstream of larger animals.
But the reason that a sugar is water soluble is because its carbon chain is festooned with hydroxy groups, where an oxygen atom takes a place between a carbon atom and a hydrogen atom. This makes the molecule soluble in water, but it also means that a sugar atom has half the energy it could have. Since the body makes energy by burning carbon chains, a sugar molecule is in effect already half-burnt. This means sugar has half the caloric value of fat, which also means that the body would need twice as much volume to store energy as sugar.
And that is why living things have fats. Fats are a much purer form of energy, consisting of nothing but carbon and hydrogen, ready to be oxidized. (Technical Note: For structural reasons, fats are actually stored as fatty acids, which have a few oxygen atoms in them, but that doesn't change their nutritive value). . When your body has excess sugar, it stores it in the more concentrated form of fat, and when your body needs sugar, it changes that fat back into the water soluble form of sugar. There is a lot of metabolic machinery in all living things designed to shuffle chemical energy from one form to another.
And that is the basic reason for fat. There are other uses that fat is put to, including things like insulation, but the main biological reason for fat is to store concentrated energy.
And how concentrated it is! One of the major dietary problems confronting modern people is just how much energy a small amount of fat can have. For tens of thousands of years, getting too much food was not a problem, and the concentrated energy in fat might make the difference between making it through a cold winter, or not. But in modern times, we have an almost limitless supply of concentrated food energy. Fat has 9 calories per gram. A gram of fat is about one cubic centimeter. This means that a cube 6 centimeters on a side has 216 grams of fat in it. This means that a cube six centimeters on a side of pure fat has around 1950 calories, or about as much as a normal adult would need to eat in a day. The amount of fat needed to sustain life in a day would easily fit in the palm of your hand.
Not that people go around chewing down on pure lard, or sipping table spoons of canola oil, but it does show just how quickly a small amount of fat can add up to many calories. A few tablespoons of oil added to a dish can add 200 or 300 calories. Over time, this fat accumulates and makes people...fat. Since fat is concentrated, it is easy to forget that this is happening.
So fat is a simple biochemical solution to the problem of storing energy, that has made living easier for plants and animals for hundreds of millions of years, and which just in the past few decades has become a major health problem for those of us living in the first world.