In his work, Menorat Ha-maor, R. Yitzchak Aramah writes:

When hearing the shofar sounded on Rosh Hashanah, one is required to listen with intent and to realize and be cognizant that it is the Day of Judgment when the Holy One, blessed is He, sits on the throne of judgment and all of Creation passes before Him like sheep whom the shepherd inspects, and decides, "This one shall be slaughtered and this one shall continue to live."

In the same fashion, man passes before G‑d on Rosh Hashanah and all of his actions that are all recorded are read before G‑d. No man knows whether he has been judged to die or to live. He must therefore listen with intent to the shofar, for its sounding serves to remind man to repent and return to G‑d Who will have mercy upon him so that he will be judged not culpable on the Day of judgment.

Abudraham quotes a midrash on Psalms

"Sound the shofar to mark the new month" (Psalms 81:4)

R. Berachyah taught in the name of Abba: [G‑d says:] Improve [the Hebrew shapru is from the same root as shofar, connoting improvement, beauty, and embellishment] your actions, sanctify your actions. just as with the shofar one blows in from one side and the sound comes from the other side, so too do all of the accusers of the world stand before Me and accuse you [of sinning and being unworthy of mercy]. But I hear their accusations from one side and remove them from the other side.