Rambam explains that virtues are not born of single acts but are formed by repeated experience that gradually reshapes the soul's dispositions — true ethical character is the result of internalizing repeated moral action until it becomes second nature.
ודע שאלו המעלות והפחיתויות אשר למידות לא יגיעו ולא יתישבו בנפש, רק בכפול הפעולות הבאות מן המידה ההיא פעמים רבות ובזמן ארוך והרגילות בהן. ואם היו הפעולות ההן טובות, יהיה המגיע לנו מהן - מעלה. ואם היו רעות, יהיה המגיע לנו מהן - פחיתות. ומפני שאין אדם בטבעו בתחילת ענינו בעל מעלה, ולא בעל חסרון - כמו שנבאר בפרק השמיני - והוא ירגיל בלא ספק פעולות מקטנותו, כפי מנהג קרוביו ואנשי ארצו. ואפשר שיהיו הפעולות ההן ממוצעות, ואפשר שיהיו מותירות, או מחסרות, כפי שספרנו, ותהיה נפשו חולה - ראוי שילכו ברפואתו כדרך רפואות הגופות בשוה: כשם שהגוף, כשיצא משוויו נראה אל איזה צד נטה ויצא, ונעמוד כנגדו בהפכו, עד שישוב אל השווי. וכשישתוה, נסלק ידינו מן ההפוך ונשוב לעשות לו מה שיעמידהו על שוויו - כן נעשה במידות בשוה. והמשל בו: כשנראה אדם שהיתה לו תכונה בנפשו וחסר בה נפשו מכל טובה לרוב הכילות - וזו פחיתות מפחיתויות הנפש. והפועל אשר יעשהו - מפעולות הרע, כמו שבארנו בזה הפרק. וכשנרצה לרפואות זה החולי, לא נצוהו להרגיל בנדיבות - שזהו, כמו שירפא מי שיגבר עליו החום בדבר הממוצע השוה, שלא יבריאהו מחוליו. אבל צריך שנביאהו לפזר, ויכפול מעשה הפיזור פעם אחר פעם פעמים רבות, עד שתסור מנפשו התכונה המחיבת לכילות, ויהיה קרוב להגיע אל תכונת הפיזור - ואז נסלק פעולות הפיזור, ונצוהו להתמיד על פעולות הנדיבות וישקוד עליהן: לא יותיר ולא יחסר.
Know, moreover, that these moral excellences or defects cannot be acquired, or implanted in the soul, except by means of the frequent repetition of acts resulting from these qualities, which, practised during a long period of time, accustoms us to them. If these acts performed are good ones, then we shall have gained a virtue; but if they are bad, we shall have acquired a vice. Since, however, no man is born with an innate virtue or vice, as we shall explain in Chapter VIII, and, as every one's conduct from childhood up is undoubtedly influenced by the manner of living of his relatives and countrymen, his conduct may be in accord with the rules of moderation; but, then again, it is possible that his acts may incline towards either extreme, as we have demonstrated, in which case, his soul becomes diseased. In such a contingency, it is proper for him to resort to a cure, exactly as he would were his body suffering from an illness. So, just as when the equilibrium of the physical health is disturbed, and we note which way it is tending in order to force it to go in exactly the opposite direction until it shall return to its proper condition, and, just as when the proper adjustment is reached, we cease this operation, and have recourse to that which will maintain the proper balance, in exactly the same way must we adjust the moral equilibrium. Let us take, for example, the case of a man in whose soul there has developed a disposition [of great avarice] on account of which he deprives himself [of every comfort in life], and which, by the way, is one of the most detestable of defects, and an immoral act, as we have shown in this chapter. If we wish to cure this sick man, we must not command him merely [to practise] deeds of generosity, for that would be as ineffective as a physician trying to cure a patient consumed by a burning fever by administering mild medicines, which treatment would be inefficacious. We must, however, induce him to squander so often, and to repeat his acts of profusion so continuously until that propensity which was the cause of his avarice has totally disappeared. Then, when he reaches that point where he is about to become a squanderer, we must teach him to moderate his profusion, and tell him to continue with deeds of generosity, and to watch out with due care lest he relapse either into lavishness or niggardliness.