Why foundation is provided?

to keep the structure connected and stable on soil underneath.So It transfers all static like gravity and dynamic like wind earthquake, tidal and etc.