Ok, spoiler rundown for Ice King.
He was a happy man named Simon who was turned insane by a crown that he picked up on an expedition.
He left his girlfriend Betty to save her from himself and then world war 3 happened.
He found a girl named Marceline and cared for her through the apocalypse.
However, being forced to use the ice crown to save her one too many times caused his mental stability to deteriorate. Not long after he left Marcy for fear of hurting her as the crown continued to make him go insane.
After years of being ice king, and forgetting who he was, he was finally able to return as Simon as all the magic was sucked from his crown in an accident. He used magic to bring Betty to the future, but without the magic in the crown, Simon lost jis immortality and his years were catching up to him.
So, Betty reverted the accident, forcing Simon to become ice king once more, and now she was trapped in the future. Betty struggled to find a way to revert Ice King to Simon, even putting on Magic Man's hat and becoming insane herself, but it was no use.
SPOILERS FOR SERIES FINALE
Betty channeled the power of GOLB, a space God of chaos, to try to bring back Simon, but was swallowed by the creature along with Ice King. Inside it's gut, they reverted back to their states before world war 3, and made up for lost time. However, they were being digested and since GOLB's gut reverts things back to their first state, the ice crown became the wishing crown it was originally made for. Simon escapes, but Betty stays behind to use the crown to banish GOLB from Ooo. The beast is to powerful to be banished however, and she instead wishes for the power to protect Simon, merging her with GOLB. Simon sees this happen and is powerless to stop it as she goes back into the void GOLB came from.
The ending of the episode shows Simon travelling to Prismo to find a way to bring Betty back.