Discuss the theoretical principles of soil mechanics, including the key factors influencing soil behavior and stability.