The Chinukh discusses the mitzvah and spiritual purpose of teshuvah as a return to God that rectifies sin and shapes the person's future conduct. It is useful for understanding repentance as an active moral transformation, not only a legal procedure.
מִשָּׁרְשֵׁי הַמִּצְוָה. לְפִי שֶׁבְּהוֹדָאַת הֶעָוֹן בַּפֶּה תִּתְגַּלֶּה מַחְשֶׁבֶת הַחוֹטֵא וְדַעְתּוֹ, שֶׁהוּא מַאֲמִין בֶּאֱמֶת, כִּי גָּלוּי וְיָדוּעַ לִפְנֵי הָאֵל בָּרוּךְ הוּא כָּל מַעֲשֵׂהוּ, וְלֹא יַעֲשֶׂה עַיִן רוֹאָה כְּאֵינָהּ רוֹאָה, גַּם מִתּוֹךְ הַזְכָּרַת הַחֵטְא בִּפְרָט וּבְהִתְנַחֲמוֹ עָלָיו יִזָּהֵר מִמֶּנּוּ יוֹתֵר פַּעַם אַחֶרֶת לְבַל יְהִי נִכְשָׁל בּוֹ, אַחַר שֶׁיֹּאמַר בְּפִיו כָּזוֹ וְכָזוֹ עָשִׂיתִי וְנִסְכַּלְתִּי בְּמַעֲשַׂי, יִהְיֶה נִגְדָּר שֶׁלֹּא יָשׁוּב לַעֲשׂוֹת כֵּן, וּמִתּוֹךְ כָּךְ יֵרָצֶה לִפְנֵי בּוֹרְאוֹ בָּרוּךְ הוּא. וְהָאֵל הַטּוֹב הֶחָפֵץ בְּטוֹבַת בְּרִיּוֹתָיו הִדְרִיכָם בְּדֶרֶךְ זוֹ יִזְכּוּ בָּהּ. מִדִּינֵי הַמִּצְוָה. מָה שֶׁאָמְרוּ זִכְרוֹנָם לִבְרָכָה (תענית טז, א) שֶׁהַתְּשׁוּבָה הִיא שֶׁיַּעֲזֹב הַחוֹטֵא חֶטְאוֹ וִיסִירֶנּוּ מִלִּבּוֹ וּמִמַּחְשַׁבְתּוֹ וְיִגְמֹר בְּלִבּוֹ שֶׁלֹּא יַעֲשֶׂה כֵן עוֹד. כְּדִכְתִיב (ישעיהו נה ז) יַעֲזֹב רָשָׁע דַּרְכּוֹ וְאִישׁ אָוֶן מַחְשְׁבֹתָיו. וְאַחַר כָּךְ יִתְוַדֶּה עָלָיו. כְּלוֹמַר שֶׁיֹּאמַר דִּבְרֵי הַתְּשׁוּבָה בְּפִיו, שֶׁנֶּאֱמַר (שמות לב לא) וַיַּעֲשׂוּ לָהֶם אֱלֹהֵי זָהָב. וְגַם כֵּן צָרִיךְ לְהַזְכִּיר בְּפֵרוּשׁ שֶׁלֹּא יָשׁוּב לַעֲשׂוֹת הַחֵטְא עוֹד, שֶׁנֶּאֱמַר (הושע יד ד) וְלֹא נֹאמַר עוֹד אֱלֹהֵינוּ לְמַעֲשֵׂה יָדֵינוּ וְגוֹ'. וְאָמְרוּ זִכְרוֹנָם לִבְרָכָה (עי' רמב"ם הל' תשובה פ"א הל"ב), שֶׁשָּׂעִיר הַמִּשְׁתַּלֵּחַ הָיָה מְכַפֵּר כְּשֶׁעָשָׂה תְּשׁוּבָה עַל כָּל עֲבֵרוֹת שֶׁבַּתּוֹרָה הַקַּלּוֹת וְהַחֲמוּרוֹת, בֵּין שֶׁעָבַר עֲלֵיהֶן בְּזָדוֹן אוֹ בִּשְׁגָגָה, בֵּין שֶׁהוֹדַע לוֹ אוֹ לֹא הוֹדַע לוֹ, אֲבָל אִם לֹא עָשָׂה תְּשׁוּבָה אֵין שָׂעִיר הַמִּשְׁתַּלֵּחַ מְכַפֵּר אֶלָּא עַל הַקַּלּוֹת. וּמַה הֵן הַקַּלּוֹת וּמַה הֵן הַחֲמוּרוֹת? עֲבֵרוֹת שֶׁחַיָּבִין עֲלֵיהֶן מִיתַת בֵּית דִּין אוֹ כָּרֵת, וְכֵן שְׁבוּעַת שָׁוְא וְשֶׁקֶר, אַף עַל פִּי שֶׁאֵין בָּהֶם כָּרֵת מִן הַחֲמוּרוֹת הֵן, וּשְׁאָר מִצְוֹת עֲשֵׂה וְלֹא תַעֲשֶׂה שֶׁאֵין בָּהֶם כָּרֵת נִקְרָאוֹת קַלּוֹת כְּנֶגֶד הַחֲמוּרוֹת. וְעַכְשָׁו בַּעֲוֹנֹתֵינוּ שֶׁאֵין לָנוּ מִקְדָּשׁ, וְלֹא מִזְבֵּחַ כַּפָּרָה אֵין לָנוּ אֶלָּא תְּשׁוּבָה, וְהַתְּשׁוּבָה מְכַפֶּרֶת עַל כָּל הָעֲבֵרוֹת, וַאֲפִלּוּ הָיָה רָשָׁע גָּמוּר כָּל יָמָיו וְעָשָׂה תְּשׁוּבָה שְׁלֵמָה בָּאַחֲרוֹנָה אֵין מַזְכִּירִין לוֹ שׁוּם רִשְׁעוֹ, שֶׁנֶּאֱמַר (יחזקאל לג יב) וְרִשְׁעַת הָרָשָׁע לֹא יִכָּשֶׁל בָּהּ בְּיוֹם שׁוּבוֹ מֵרִשְׁעוֹ וְגוֹ'. בַּמֶּה דְבָרִים אֲמוּרִים שֶׁהַתְּשׁוּבָה לְבַדָּהּ מַסְפֶּקֶת בַּעֲבֵרוֹת שֶׁבֵּין אָדָם לַמָּקוֹם, כְּגוֹן הָאוֹכֵל דָּבָר אָסוּר אוֹ בּוֹעֵל בְּעִילָה אֲסוּרָה, וְכֵן הַמְבַטֵּל אַחַת מִמִּצְוֹת עֲשֵׂה וְכַיּוֹצֵא בָּזֶה, אֲבָל עֲבֵרוֹת שֶׁבֵּין אָדָם לַחֲבֵרוֹ, כְּגוֹן הַחוֹבֵל בַּחֲבֵרוֹ, אוֹ הַגּוֹזֵל מָמוֹנוֹ, אוֹ בְּכָל דָּבָר אַחֵר שֶׁהִזִּיקוֹ שֶׁלֹּא כַּדִּין בֵּין בְּמַעֲשֶׂה בֵּין בְּדִבּוּר, אֵין נִמְחָל לוֹ לְעוֹלָם בִּתְשׁוּבָה בִּלְבַד, עַד שֶׁיִּתֵּן לַחֲבֵרוֹ מַה שֶּׁהוּא חַיָּב לוֹ וְעַד שֶׁיְּרַצֵּהוּ, וְאִם לֹא רָצָה חֲבֵרוֹ לְהִתְרַצּוֹת לוֹ כְּבָר אָמְרוּ זִכְרוֹנָם לִבְרָכָה (יומא פז א), מָה תַּקָּנָתוֹ. וּמֵעִנְיַן הַמִּצְוָה כְּמוֹ כֵן, מָה שֶׁאָמְרוּ בַּתּוֹסֶפְתָּא, שֶׁעֶשְׂרִים וְאַרְבָּעָה דְּבָרִים הֵם שֶׁמְּעַכְּבִין אֶת הַתְּשׁוּבָה, וְשָׁם מָנוּ אוֹתָן חֲכָמִים. וְיֶתֶר פְּרָטֵי הַמִּצְוָה יִתְבָּאֲרוּ בְּפֶרֶק אַחֲרוֹן מִיּוֹמָא [הלכות תשובה פ"א].
It is from the roots of this commandment [that it is] because through the verbal admission of iniquity, the sinner reveals his thoughts and opinion: that he truly believes that all his deeds are revealed and known before God, blessed be He, and that he will not act as if ‘the Eye that sees’ does not see. Furthermore, through mentioning the sin specifically, and through his remorse about it, he will be more careful about it on another occasion not to stumble in the same way again. Since he declares verbally, “I did such-and-such, and I stumbled in my deeds,” he will have created a fence so he will not repeat what he did. And through this he will be wanted by his Creator, blessed be He. And the Good God, Who wants the good for His creations makes them walk in this way, [that] they merit with it. From the laws of the commandment is that which they, may their memory be blessed, said (Taanit 15a) that repentance is that the sinner leave the sin and remove it from his heart and from his thought, and he decide in his heart not to do like this again, as it is written (Isaiah 55:7), “Let the wicked give up his way, the sinful man his thoughts”; and afterwards, he must confess about it, meaning to say that he say the words of repentance orally, as it is stated (Exodus 32:31), “and they made for themselves a god of gold.” And he must also mention explicitly that he will not return to do the sin again, as it is stated (Hosea 14:4), “and we will not again say ‘our god’ about the work of our hands, etc.” And they, may their memory be blessed, said (see Rambam, Mishneh Torah, Laws of Repentance 1:2) that the scapegoat would atone for all sins when one repented, light and weighty — whether he transgressed them volitionally or accidentally whether it was known to him or unknown to him. But if he did not repent, the scapegoat only atones for the light ones. And what are the light ones and what are the weighty ones? [Weighty ones] are sins for which one is liable for the death penalties of the court or excision; and also vain and false oaths are from the weighty ones, even though they do not come with excision. And the other positive and negative commandments that do not come with excision are called light, in comparison to the weighty ones. And now that we do not have the Temple and the altar of atonement, on account of our iniquities, we only have repentance. And repentance atones for all sins. And even if one was a complete evildoer all of his days and he repented completely at the end, we do not mention any of his evil, as it is stated (Ezekiel 33:12), “and the wickedness of the wicked will not cause him to stumble when he turns back from his wickedness, etc.” To what do these words apply that repentance alone suffices? To sins between man and the Omnipresent, such as one who eats something prohibited or has a prohibited sexual intercourse and so [too,] one who negates one of the positive commandments and similar to it. But [regarding] sins between a man and his fellow, such as one who injures his fellow, or robs his money or with any other thing through which he illegally injures him — whether in action or in speech — it is never forgiven him with repentance alone, until he gives his fellow what he owes him and until he is appeased. And they, may their memory be blessed, have already said (Yoma 87a) what is his remedy if his fellow does not want to be appeased by him. And also from the content of the commandment is that which they said in the Tosefta that there are twenty-four things that impede repentance, and they enumerate them there. [This] and the rest of the details of the commandment are elucidated in the last chapter of Yoma. (See Mishneh Torah, Laws of Repentance 1.)