Smart Grids and AI: Revolutionizing Energy Distribution and Management