Three matzot are arranged on the Seder plate. After eating karpas, before reciting the Hagada, the Seder leader (and whoever else has three matzot in front of him), breaks the middle matza in half. One piece is saved for the afikoman, and the other is left between the two whole matzot (SA 463:6).
The reason for this is that the matza alludes to our poverty and enslavement in Egypt, and is hence called “leĥem oni” – “poor man’s bread” (Devarim 16:3). Paupers often eat partial loaves of bread because they are unable to buy whole loaves. So, in order to give expression to the poverty, we break the matza in half. We do this before beginning the Hagada since the Hagada should be recited in the presence of the matza. This is because the term “leĥem oni” also means “bread over which we ‘onim’ – answer or say – many things,” and this means that the Hagada must be recited while the matza, in the form it will be eaten, is before us. This is why it must be broken in half before we begin the Hagada.
Nevertheless, on the Seder night, just like on every Shabbat and Yom Tov, there is a mitzva to recite ha-motzi over two whole loaves of bread/matza (“leĥem mishneh”). Therefore, we set the table with three matzot: the middle one is broken in half to give expression to leĥem oni, while the top and bottom matzot remain whole and serve as leĥem mishneh. (Later, when reciting “ha-motzi,” one should hold all three matzot so that there is leĥem mishneh, and before reciting the berakha of “al akhilat matza,” we put down the bottom matza and recite the blessing over the top and middle matzot, in order to highlight the broken matza to a greater degree.)
The larger piece of the broken matza is designated as the afikoman, and the custom is to wrap it in a napkin, in recollection of the verse, “The people took their dough before it was leavened; their kneading leftover dough was wrapped in their robes” (Shemot 12:34). Some people have a custom to place the afikoman on their shoulder for a moment, in remembrance of the Exodus, when people carried matzot on their shoulders (MB 473:59).
Afterward, we hide the afikoman and save it until the end of the Seder, when it is eaten in commemoration of the Paschal sacrifice (see sections 33 and 34 below).
In many homes, the children customarily “steal” the afikoman and keep it until the end of the meal, when they give it back in return for a gift. This helps them stay awake for the entire Seder. In my family, we give gifts to all children who remain awake until after the afikoman is eaten.