Rambam describes how teshuvah brings a person close to the Shekhinah and declares that the ba'al teshuvah reaches a level that even the perfectly righteous cannot attain — deliberate sins become merits through the power of return.
גְּדוֹלָה תְּשׁוּבָה שֶׁמְּקָרֶבֶת אֶת הָאָדָם לַשְּׁכִינָה שֶׁנֶּאֱמַר (הושע יד ב) "שׁוּבָה יִשְׂרָאֵל עַד ה' אֱלֹהֶיךָ". וְנֶאֱמַר (עמוס ד ו) "וְלֹא שַׁבְתֶּם עָדַי נְאֻם ה'". וְנֶאֱמַר (ירמיה ד א) "אִם תָּשׁוּב יִשְׂרָאֵל נְאֻם ה' אֵלַי תָּשׁוּב". כְּלוֹמַר אִם תַּחֲזֹר בִּתְשׁוּבָה בִּי תִּדְבַּק. הַתְּשׁוּבָה מְקָרֶבֶת אֶת הָרְחוֹקִים. אֶמֶשׁ הָיָה זֶה שָׂנאוּי לִפְנֵי הַמָּקוֹם מְשֻׁקָּץ וּמְרֻחָק וְתוֹעֵבָה. וְהַיּוֹם הוּא אָהוּב וְנֶחְמָד קָרוֹב וְיָדִיד. וְכֵן אַתָּה מוֹצֵא שֶׁבְּלָשׁוֹן שֶׁהַקָּדוֹשׁ בָּרוּךְ הוּא מַרְחִיק הַחוֹטְאִים בָּהּ מְקָרֵב אֶת הַשָּׁבִים בֵּין יָחִיד בֵּין רַבִּים. שֶׁנֶּאֱמַר (הושע ב א) "וְהָיָה בִּמְקוֹם אֲשֶׁר יֵאָמֵר לָהֶם לֹא עַמִּי אַתֶּם יֵאָמֵר לָהֶם בְּנֵי אֵל חָי". וְנֶאֱמַר בִּיכָנְיָהוּ בְּרִשְׁעָתוֹ (כְּתֹב) [כִּתְבוּ] (ירמיה כב ל) "אֶת הָאִישׁ הַזֶּה עֲרִירִי גֶּבֶר לֹא יִצְלַח בְּיָמָיו", (ירמיה כב כד) "אִם יִהְיֶה כָּנְיָהוּ בֶּן יְהוֹיָקִים מֶלֶךְ יְהוּדָה חוֹתָם עַל יַד יְמִינִי" וְגוֹ'. וְכֵיוָן שֶׁשָּׁב בְּגָלוּתוֹ נֶאֱמַר בִּזְרֻבָּבֶל בְּנוֹ (חגי ב כג) "בַּיּוֹם הַהוּא נְאֻם ה' צְבָאוֹת אֶקָּחֲךָ זְרֻבָּבֶל בֶּן שְׁאַלְתִּיאֵל עַבְדִּי נְאֻם ה' וְשַׂמְתִּיךָ כַּחוֹתָם": כַּמָּה מְעֻלָּה מַעֲלַת הַתְּשׁוּבָה. אֶמֶשׁ הָיָה זֶה מֻבְדָּל מֵה' אֱלֹהֵי יִשְׂרָאֵל שֶׁנֶּאֱמַר (ישעיה נט ב) "עֲוֹנוֹתֵיכֶם הָיוּ מַבְדִּלִים בֵּינֵכֶם לְבֵין אֱלֹהֵיכֶם". צוֹעֵק וְאֵינוֹ נַעֲנֶה שֶׁנֶּאֱמַר (ישעיה א טו) "כִּי תַרְבּוּ תְפִלָּה" וְגוֹ'. וְעוֹשֶׂה מִצְוֹת וְטוֹרְפִין אוֹתָן בְּפָנָיו שֶׁנֶּאֱמַר (ישעיה א יב) "מִי בִקֵּשׁ זֹאת מִיֶּדְכֶם רְמֹס חֲצֵרָי", (מלאכי א י) "מִי גַם בָּכֶם וְיִסְגֹּר דְּלָתַיִם" וְגוֹ'. וְהַיּוֹם הוּא מֻדְבָּק בַּשְּׁכִינָה שֶׁנֶּאֱמַר (דברים ד ד) "וְאַתֶּם הַדְּבֵקִים בַּה' אֱלֹהֵיכֶם". צוֹעֵק וְנַעֲנֶה מִיָּד שֶׁנֶּאֱמַר (ישעיה סה כד) "וְהָיָה טֶרֶם יִקְרָאוּ וַאֲנִי אֶעֱנֶה". וְעוֹשֶׂה מִצְוֹת וּמְקַבְּלִין אוֹתָן בְּנַחַת וְשִׂמְחָה שֶׁנֶּאֱמַר (קהלת ט ז) "כִּי כְבָר רָצָה הָאֱלֹהִים אֶת מַעֲשֶׂיךָ". וְלֹא עוֹד אֶלָּא שֶׁמִּתְאַוִּים לָהֶם שֶׁנֶּאֱמַר (מלאכי ג ד) "וְעָרְבָה לַה' מִנְחַת יְהוּדָה וִירוּשָׁלםִ כִּימֵי עוֹלָם וּכְשָׁנִים קַדְמֹנִיּוֹת":
Teshuvah is great for it draws a man close to the Shechinah as [Hoshea 14:2] states: "Return, O Israel, to God, your Lord;" [Amos 4:6] states: "`You have not returned to Me,' declares God;" and [Jeremiah 4:1] states: "`If, you will return, O Israel,' declares God, `You will return to Me.'" Implied is that if you will return in Teshuvah, you will cling to Me. Teshuvah brings near those who were far removed. Previously, this person was hated by God, disgusting, far removed, and abominable. Now, he is beloved and desirable, close, and dear. Similarly, we find God employs the same expression with which He separates [Himself] from the sinners to draw close those who repent. [Hoshea 2:1] states: "Instead of saying to you: `You are not My nation,' He will tell you: `You are the children of the living God.'” [Also, Jeremiah] speaks of Yecheniah while he was wicked [with the expression (22:30)]: "Write down this man as childless, a man who shall never prosper in his days," and [22:24]: "Would Cheniah, the son of Yehoyakim, king of Judah, be the signet ring on My right hand, I would tear him off." However, after he repented when in exile, [Chaggai 2:23] said concerning Zerubavel, his son: "'On that day,' declares the God of Hosts, `I will take you, Zerubavel, the son of Shaltiel, My servant,' declares God, `and I will place you as a signet ring.'" How exalted is the level of Teshuvah! Previously, the [transgressor] was separate from God, the Lord of Israel, as [Isaiah 59:2] states: "Your sins separate between you and your God." He would call out [to God] without being answered as [Isaiah 1:15] states: "Even if you pray many times, I will not hear." He would fulfill mitzvot, only to have them crushed before him as [Isaiah 1:12] states: "Who asked this from you, to trample in My courts," and [Malachi 1:10] states: "`O were there one among you who would shut the doors that you might not kindle fire on My altar for no reason! I have no pleasure in you,' says the God of Hosts, `nor will I accept an offering from your hand.'” Now, he is clinging to the Shechinah as [Deuteronomy 4:4] states: "And you who cling to God, your Lord." He calls out [to God] and is answered immediately as [Isaiah 65:24] states: "Before, you will call out, I will answer." He fulfills mitzvot and they are accepted with pleasure and joy as [Ecclesiastes 9:7] states, "God has already accepted your works," moreover, [G‑d] desires them, as [Malachi 3:4] states: "Then, shall the offering of Judah and Jerusalem be pleasing to God as in days of old and as in the former years."