The answer that Chazal give comes from Parshas Vayelech. "VeAnochi haster astir panay bayom hahu". "And I will hide, hide my face on that day."
Then My anger shall be kindled against them in that day, and I will forsake them, and I will hide My face from them, and they shall be devoured, and many evils and troubles shall come upon them; so that they will say in that day: Are not these evils come upon us because our God is not among us?
And I will hide, hide my face on that day for all the evil that they have, in that they turned to other gods.
Purim and Yom Kippur have a linguistic connection of their own with Yom Kippur being described as Yom K'Purim, a day like Purim, even though the days appear to be complete opposites.
On Yom Kippur Jews fast and repent and plead for their lives. On Purim, they celebrate with abandon. And yet Purim is described as being even greater than Yom Kippur.
The connection between Yayelech and the events of Purim is made by the hiddenness of G-d. The Megillah never mentions G-d. There is no open miracle. Instead the hand of G-d is hidden. But Purim is preceded by Taanit Esther. The Jews fast and repent, they recognize that this crisis has come upon them because they sinned, and yet G-d remains hidden, but still saves them.
In these psukim, G-d appears to hide twice. He hides during the crisis. And He hides after the Jews repent and He saves them.
The first hiddenness of G-d is Yom Kippur. Though we are told that He waits for us to repent in Elul, we still must build a relationship with Him. This relationship is incomplete. We recognize that we sinned and do our best to repent, but the repentance is incomplete. We say that G-d is not among us, but He is. He remains hidden because we have not succeeded in rebuilding our relationship with Him.
Despite G-d remaining hidden, when we turn to G-d, He saves us from the evils that have upon us without revealing Himself. After Yom Kippur, the repentance, we eventually merit a Purim. And Purim is greater than Yom Kippur because even though G-d is still hidden, we have come close enough to Him to be saved from our troubles, even if we have not merited a larger revelation.
The first hiddenness of G-d is repentance in times of trouble. The second is salvation from those troubles.
Even on Purim, the Jews continue to be flawed. They continue to worship other gods, even if these aren't literal deities, but other 'masters' and 'lords' such as materialism or egotism. They have not yet turned away from these toward G-d and therefore G-d remains hidden from them. But as long as the Jews remember the missing space where G-d is, they can still merit to be saved by His hidden hand.
The worst form of sin is the abandonment of the knowledge that it is even wrong. It is when this takes place, that G-d turns away from people for they have forgotten Him. When they remember that the sin is wrong and that G-d is missing from their lives, then they may not see G-d, but G-d is in their lives, even if as a sense of emptiness and the knowledge that something is absent and missing.
On Yom Kippur, we acknowledge the sin. We try to fill the emptiness by turning to G-d. It is an incomplete process, but it still brings us closer to G-d even if we don't see it or know it.
Few people repent fully on Yom Kippur, but at the very least they must acknowledge that emptiness in their lives where G-d should be, but isn't. And then they may find that though they do not 'see' G-d, hidden miracles occur in their lives that save them from their troubles. If they celebrate these miracles, as we do on Purim, then they can come even closer to G-d.