"I give thanks unto You, O living and eternal King, for having restored within me my soul, with mercy; great is Your trust."
The first thing we become aware of when we awake from our sleep in the morning is that we are awake and alive. When we went to bed the night before, we were tired and exhausted, "dead-tired"; we wake up refreshed, in both body and soul, as if we were reborn again. It is only right that we should thank G‑d for it.
Our Sages have told us that every night when we go to sleep, our Divine soul returns to its heavenly abode and gives an account of the good deeds and bad which the soul, in partnership with the body, had done during the day. Indeed, in the prayer before going to bed we say, "Into Your Hand I pledge my soul; You have redeemed me, O G‑d, G‑d of truth."1 A pledge is something that the debtor gives to the creditor as security that the debt would be paid, and usually the creditor will not return the pledge as long as the debtor still owes him money. But G‑d is very merciful, and although every day we are indebted to Him, He returns our soul to us.
Furthermore, our Sages declare: When a person gives a pledge, even if it is a new thing, it becomes old and stained by the time it is returned. But G‑d returns our "pledge" new and polished, even though it had been "used," and so it is written, "They are new every morning; great is Your trust. 2 How grateful we must be to G‑d.3
Incidentally, the fact that we go to bed "dead tired" and wake up refreshed, returning from the unconscious world of slumber, is something like a "revival of the dead." It strengthens our conviction of the "Resurrection of the Dead" (תחית המתים), and this adds further meaning to the words "great is Your trust," for we have absolute trust in G‑d, not only that He will return our soul in the morning, but also will return our soul into our body at the end of days, when all the righteous dead will rise from their "sleep." (We affirm this clearly in the second blessing of the Shemone Esrei— ונאמן אתה להחיות מתים--"You are trust-worthy to revive the dead.")
Modeh ani is said immediately upon our awakening, even before we have washed our hands, because G‑d's proper Name is not mentioned in this prayer, but only "King."