Delve into the theoretical underpinnings of geotechnical engineering as it pertains to the design and construction of deep excavations in urban environments. Discuss methods for analyzing soil behavior under varying loading conditions and the factors influencing excavation stability.