The transformation of energy management systems (EMS) in microgrids has evolved from traditional optimization techniques to intelligent, decentralized architectures driven by artificial intelligence (AI). This review work highlights the limitations of conventional programming methods such as linear, nonlinear, and mixed-integer models in handling the variability of renewable sources. Modern AI techniques, including deep reinforcement learning, bidirectional long short- term memory networks, and fuzzy logic controllers, provide real-time adaptability and predictive accuracy. Additionally, blockchain-based peer-to-peer (P2P) energy trading introduces secure, transparent, and autonomous coordination among distributed agents. Through a comparative analysis, this work underscores the benefits, challenges, and integration potential of these approaches, advocating for hybrid AI and optimization frameworks to enable resilient, efficient, and user-centric microgrid operations.