Fundamental Aspects of Magnetic Shape Memory Alloys: Insights from Ab Initio and Monte Carlo Studies