How does the concept of strain energy relate to the resilience of materials in mechanical design? Discuss its significance in ensuring structural integrity and durability.