I have been asked this question by a few non-catholics and I don’t really know the answer.
New Life, New Name
As the newly elected pope accepts his new role, it is tradition for him to select a new name. This papal tradition dates to 533 and the election of Pope John II, whose birth name was Mercurius, according to the Catholic Encyclopedia. Mercurius is derived from Mercury, a pagan Roman god. Believing that a successor of St. Peter should not carry a name belonging to a pagan religion, Mercurius chose to change his name upon his election to honor a previous pope.
While some that followed John II chose to retain their original name, it soon became commonplace for new popes to choose a new moniker. The name change also symbolizes the new life that the new pope is entering as the head of the Catholic Church. Typically, the new pope selects the name of his favorite Saint or a former pope whom he admires.
[For example] John Paul II chose his name to honor his predecessor, John Paul I, who died just 33 days after being elected pope. John Paul I chose his name to honor predecessors Pope John XXIII and Pope Paul VI.
Thank you, Fidelis!