Artificial intelligence (AI) and machine learning (ML) can assist in the effective development of the power system by improving reliability and resilience. The rapid advancement of AI and ML is fundamentally transforming energy management systems (EMSs) across diverse industries, including areas such as prediction, fault detection, electricity markets, buildings, and electric vehicles (EVs). Consequently, to form a complete resource for cognitive energy management techniques, this review paper integrates findings from more than 200 scientific papers (45 reviews and more than 155 research studies) addressing the utilization of AI and ML in EMSs and its influence on the energy sector. The paper additionally investigates the essential features of smart grids, big data, and their integration with EMS, emphasizing their capacity to improve efficiency and reliability. Despite these advances, there are still additional challenges that remain, such as concerns regarding the privacy of data, challenges with integrating different systems, and issues related to scalability. The paper finishes by analyzing the problems and providing future perspectives on the ongoing development and use of AI in EMS.