Just as kiddush is in prayer and over the cup, so too havdalah must be performed in prayer, which is to say that one adds in the blessing of "Atah Chonen" the passage "Atah Chonantanu, and You have distinguished us, Hashem our G-d, between the sacred and the profane, etc.," and also over the cup. Thus the Men of the Great Assembly ordained, that one requires havdalah in prayer and over the cup, and one who does so, blessings shall rest upon his head (Berakhot 33a). They ordained havdalah in "Chonen HaDa'at" because it is wisdom to distinguish between the sacred and the profane, and they established it in the blessing of wisdom (Tur, siman 115), for through knowledge we mention the virtue of rest, and we know how to distinguish between the sacred and the profane (Talmidei Rabbeinu Yonah, ibid.), and if there is no knowledge—there is no havdalah, for knowledge in physicality is animalistic knowledge, and the essence of knowledge is in spirituality, which is the knowledge of the Torah and the fulfillment of its mitzvot. This is why we say "You have graced us with the knowledge of Your Torah, and You have taught us to perform the statutes of Your will, and You have distinguished, Hashem our G-d, between the sacred and the profane, etc."—behold, these are dependent upon one another.
כשם שקידוש הוא בתפ(י)לה ועל הכוס, כמו כן הבדלה צריך להבדיל בתפ(י)לה, והיינו שמוסיף בברכת אתה חונן 'אתה חוננתנו ותבדילנו ד' אלקינו בין קדש לחול וכו', וגם על הכוס. וכך תקנו אנשי כנסת הגדולה, שצריך הבדלה בתפ(י)לה ובכוס, והעושה כן ינוחו לו ברכות על ראשו (ברכות ל"ג.). ותקנו הבדלה ב'חונן הדעת' מפני שהיא חכמה להבדיל בין קדש לחול, וקבעוה בברכת החכמה (טור סימן קט"ו), שעל ידי הדעת אנחנו מזכירים מעלת המנוחה, ויודעים להבדיל בין קדש לחול (תר"י שם), ואם אין דיעה - אין הבדלה, דהדעת בגשמיות הוא דעת בהמי, ועיקר הדעת הוא ברוחניות, והוא ידיעת התורה וקיום מצותיה. וזהו שאומרים 'אתה חוננתנו למדע תורתך, ותלמדנו לעשות בהם חוקי רצונך, ותבדל ד' אלקינו בין קדש לחול וכו' - הרי שתלוי זה בזה.