Explore the theoretical principles underlying soil mechanics in civil engineering, discussing soil properties, behavior under stress, and factors influencing soil stability. Explain how these principles inform foundation design and slope stability analysis in geotechnical engineering projects.