What can the fact that the king spent a sleepless night mean but that which is written in the Psalm: "See, the one who guards Israel will not sleep or slumber" (Psalms 121). They read before him the histories and chronicles of earlier times in which are mentioned the loyalty and the good deeds of Mordecai, because the king of the saints and the prince of the kings of the earth—who remains the same within himself—comes to know with a single glance the course of all the ages and the actions of every individual; and nothing ever escapes his notice, rather everything lies open before him in his si...ght. Jeremiah tells us about this: "For it is he who has strengthened all things, and Israel is the staff of his inheritance; the Lord of hosts is his name" (Jeremiah 10). Hence the apostle also says: "For in Christ Jesus there is no 'is' and 'was', but in him there is always 'is'." And likewise: "Jesus Christ is the same yesterday and today, and for all time" (Hebrews 13).
So Mordecai's actions are mentioned before this king, because the good deeds of the holy teachers never fade from his memory; rather it is as it is written: "The righteous will be in eternal memory, he will have no fear of bad tidings" (Psalms 112).
Source: Commentary on Esther