In the realm of mechanical engineering, the concept of thermodynamics plays a pivotal role. Delve into the theoretical implications of the Second Law of Thermodynamics in relation to the efficiency of heat engines. Discuss how this law dictates the maximum achievable efficiency and the practical challenges engineers face in reaching this ideal state. Additionally, explore the significance of entropy generation and its impact on system performance.