In many Nusach Ashkenaz shuls, there is a minhag to say either Adon Olam or Yigdal at the end of Shabbat / Yom Tov Ma'ariv and many say Adon Olam at the end of Musaph.
What's the reason / origin of this custom?
There is an interesting part in The Encyclopedia of Jewish Prayer: The Ashkenazic and Sephardic Rites (p. 7) citing Mateh Moshe ל"א (p. 71 in this edition). Regarding the general recital of Adon Olam, he says that all those, who sing it with much devotion, prevent the Satan to defy their prayers, while based on Mishlei 16:7, their enemies will fall. At the end we sing it for the following reason (see again Mateh Moshe רי"ו on p. 118):
Just as Bereishit is reread immediately after concluding all Five Books of the Pentateuch on Simhat Torah, Adon Olam is repeated in similar manner at the conclusion of a service so that Satan shall not be a threat.