The Mishnah (Pesachim 120a) tells us “ain maftiriin achar Pesach Afikoman. Rav Yehudah in the name of Shmuel states that the Afikoman is the last item eaten at the meal as a remembrance of the matzah that was eaten with the Karban pesach. Although Mar Zutrah quotes Shmuel as permitting one to eat after the Afikoman, the Gemara concludes that one may not do so. The Baalei Tosfos understand that Afikoman is a Greek word that means cessation from eating.
Many Rishonim ( Rambam, Rashbam, ) hold that the eating of the Afikoman is the essential part of the mitzvah of eating matzah. It should be noted that there is a substantial machlokes in the Rishonim and Acharonim as to whether one can drink anything after the afikoman because it would nullify the taste of matzah in one’s mouth .
Here are some very interesting insights, understandings and laws on Afikoman:
1)One should have two kezezim–one in memory of the Karban Pesach and another in memory of the matzah that was eaten with it.
2) Since there is a substantial body of Rishonim and Poskim who assume that the eating of the Afikoman is the essential part of the Biblical mitzvah of eating matzah, one should eat the Afikoman before chatzos (halachic midnight).
3) The question of whether Afikoman is of Biblical or Rabbinic in nature has another important practical consideration -the shiur-how much matzah to eat.
4) Why do we hide the Afikoman? RYBS explains that there is a fundamental machlokes in the understanding of the afikoman. Tosfos understand that matzah must be eaten at the end of the meal in order to retain its taste. Rosh views afikoman as a remembrance for the Karban pesach. that was eaten in a reclining position at the end of the meal. Rambam seems to be in accord with the Rash but for the following fascinating reason- The matzah that we eat for Afikoman seems to have many of the regulations that are associated with Kodshim and we wrap it in a pillow and watch it in a manner that there will be no hesesh hadas ( forgetfullness) until the time when we eat it. The Shulchan Aruch adopts the reasoning of Rambam.
5) The Avnei Nezer discusses the not uncommon problem of eating the Afikoman after Chatzos,. I will follow up, Bezras Hashem, in the comment thread of this post with a survey of how different Gedolim viewed the suggestion of the Avnei Nezer.