Colonel Hansen is a crooked Mirage Kingdom official with with one evil plan in mind: to take over the Mirage Kingdom by using Misty's Togepi and in order to do that, he enlisted the help from the TeamRockettrio to steal it from her.
After being crowned and sending Mirage Kingdom King and Mirage Kingdom Queen to the dungeon, Hansen turned on the Team Rocket trio and sent them blasting off with his Shedinja and and his two Ninjasks. Hansen is also an impure-hearted man, and due to his evil plotting of taking over the kingdom, all of the wild Togepi became exhausted and weak and the Togepi Paradise was nearly destroyed by him.
At that point, he believed that he had won and got everything he wanted. But his plans were interfered by Ash Ketchum, Misty, Brock, May, Max, Miranda, Princess Sara, and Misty's Togepi who unexpectedly evolved into a Togetic. The Team Rocket trio, who felt disgraced with Hansen's betrayal, decided to getback at Hansen and helped Ash and his friends dethrone by telling them that the King and the Queen are in the dungeon. With his Shedinja and his two Ninjasks incapacitated by Ash's Pikachu and Misty's Gyarados, the King and the Queen were freed and they immediately arrested him and sent him to the dungeon for high treason.