Chad Gadya - Why do we sing it as the Seder?
One Jewish author from the 1800's, Yitzchak Baer Levinsohn, and subsequently the Encyclopedia Judaica, write the purpose of the song is "for the amusement of the children so that they might not fall asleep before the end of the seder."
Many rabbis take issue with this trivialization, on the basis that if it became part of the holy seder service, there must be a good reason. In addition, if the purpose is to keep the children awake, it should be sung earlier, not at the very end.
(In my humble opinion, it's not meant to be sung at the end. It's meant to be sung whenever the children stop paying attention. We only sing it at the end because it was originally printed at the end as an addendum.)
The Jewish Encyclopeida (1906) writes that song seems to be an embodiment of the idea of justice, of reward and punishment, and relative order among all the objects in Creation.
Encyclopedia Judaica writes that the traditional interpretation is one "in which the kid symbolizes the oppressed Jewish people. It was bought by the father (God) for two coins (Moses and Aaron). The devouring cat stands for Assyria; the dog is Babylon; the stick represents Persia; the fire Macedonia; the water is Rome; the ox, the Saracens; the shoḥet, the Crusaders; and the Angel of Death, the Turks who in those days ruled Palestine. The end of the song expresses the hope for messianic redemption: God destroys the foreign rulers of the Holy Land and vindicates Israel, "the only kid."
It also mentions that "other commentators have tried to interpret "Ḥad Gadya" as an allegorization of the Joseph legend or of the relationship between body and soul as reflected in Jewish mysticism," but does not expand on this. Thankfully, R' Kenneth Brander does explain.
The body and soul explanation was given by Rav Yaakov Emden (1700's, Germany). He writes that The soul is compared to a small goat. The soul is the dimension of the body that our father (God) in heaven has given us. He continues to explain that the various animals and actions are things that affect the soul. For example, the Shochet represents the destructive force that is created whn one sins. Etc. A similar interpretation is given by Rabbi Chaim Yosef David Azulai (the Chida, 1700's).
Rav Yonatan Eybeschuetz (1700's, Poland), give an explanation based on the historical saga of the Jewish people. It's similar to the one listed by the Encyclopeida Judaica, with some reinterpretations, such as the Stick being Moshe's staff, and the Water being Torah. The Vilna Gaon has a similar interpretation.
A third approach is presented by R . Moses Sofer (Hatam Sofer, 1800's Germany), which R' Brander classifies as “A Review of the Passover sacrificial laws in preparation for the Messianic Age." The goat is the Korban Pesach, and each stanza is a different halacha.
In conclusion, to quote R' Avi Weiss: "One wonders, why is this deep message written in metaphor. It may be to teach that so much in Jewish history cannot be understood as it occurs, it can only be deciphered in hindsight. And it may be that the Chad Gadya is written playfully and humorously to teach that to survive against the odds requires the ability to laugh. Our very existence is difficult to believe, and in that sense almost funny."
(Please see R' Brander's article for more information.)
Echad Mi Yodea - From what I've read, the purpose is to entertain the children. There are additional answers in this question.