Soil mechanics is the branch of civil engineering that concerns with the application of principles of mechanics and hydraulics to the engineering problems related to the soil.
We can also say that it is the branch of civil engineering which deals with the study of characteristics, classification and behavior of soil under loaded and unloaded conditions.
Almost all the civil engineering structures like building, towers, bridges etc are found on soil. All these structures are very heavy as they are made up of heavy structural elements like concrete-brick, earth-brick, wood and steel. And all this load is supported by the soil below, the ultimate foundation.
Soil, in its natural and undisturbed state, is very in-homogenous or anisotropic, which means it is non uniform and diverse everywhere at any depth. So it exhibits a wide range of behaviour even when conditions are slightly different.
Lets take an example and say a turbine is installed in a thermal power station. Vibrations caused by the running turbine may alter the state of soil deposit below and around the foundation from loose to dense. Due to which foundation may settle which is, of course, undesirable.
Also the loose soil and dense soil have completely different properties.
The presence of water table or moisture content under or in the soil deposit considerably affects the loading capacity of the soil.
How much load a given soil will be able to support in its given conditions is what we would want to know as being civil engineers.
We take out a small sample of soil from the ground and derives its physical and mechanical parameters.
We should note here that since the soil is far from homogenous state, no soil sample guarantee that soil parameters derived from it are truly representative of field strata.
Then how we decide on it??
Well the final judgement from the civil engineer comes from theoretical knowledge, experience and skill.