A foundation is simply the lowest load bearing part of your home. It serves three main purposes.
Firstly, the foundation bears the weight of the entire house, transferring the force through to the ground beneath. For this reason, most (though not all) foundations are made of concrete and dug into the earth for added stability.
Secondly, your foundation essentially holds your house in place, acting as an anchor between the frame (the walls, ceilings, etc.) and the ground below. In the event of natural disasters (such as earthquakes, hurricanes and tsunamis) or more routine adverse weather conditions (such as floods, wind, and frost-heave) your foundation stops your home from being washed or blown away.
Finally, a well-laid foundation can help waterproof your property and prevent groundwater from rising into the lower reaches of your home.