According to Ramgiri Braun (student of Neemkaroli Baba, aka Laxman Das),
Hanuman, the great monkey God of the Ramayana is a symbol of the mind that has become disciplined and filled with devotion. Hanuman is the evolved state of our unruly monkey mind that constantly jumps from thought to thought. This mind is fully focused on the presence of the Divine Self, the Lord of Life within the heart.
When Rama asks Hanuman, “How do you look upon me?” the great monkey gives a three-part answer, “When I believe I am the body, then I am your faithful servant. When I know I am the soul, I know myself to be a spark of your eternal Light. And when I have the vision of truth, you and I, my Lord, are one and the same.”
With this answer, he shows us three states we flow through in our spiritual quest. Many times we identify with the person, the body-mind–ego we think we are. At those times we can realize that we are here to do God’s work, to serve that higher Self in us and in everything. This is the foundation of Karma Yoga, the yoga of service.
One level up and we realize we are not as separate from divine intelligence as we thought, that there is a higher knowing and presence working through us. We sense we are not separate from other beings and that our existence is an expression of the indescribable presence of God in us. This is where Bhakti and Raja Yoga open us further.
The most dramatic shift in our perception occurs when all veils lift and we have the vision of truth. Then we know that we are all that exists. We are the Source; we are One. Jnana Yoga aims at this direct perception.
What allows Hanuman to have this complete vision? It is faith (Shraddha). This faith is the origin of five essential levels of spiritual practice. Hanuman is, therefore, the manifestation of faith that gives us strength, which transforms our memory and leads us through samadhi to perfect wisdom.
(Faith) is based on the direct experience of Truth and therefore more solid than a rock. For those on the devotional path faith is born out of love and love grows our faith.
Hanuman experienced truth in Rama and thus gained endless faith and endless devotion. He continues,
This faith gives us strength (Virya) and allows us to remain increasingly unshaken in the ups and downs of life.
As our strength grows, it evolves our memory (Smriti). Realizing the crucial importance of our spiritual practice, our commitment becomes increasingly stable and we approach a state of continuous remembrance of our Source.
Vyasa tells us that the awareness that we are constantly loved by the Divine, is the greatest force that allows us to surrender spontaneously to the inner Source. We realize what we have been seeking is what we are.
So, upon seeing Rama, Hanuman remembered that Rama is Viṣnu and that he himself is Shiva. This further increased Hanuman's love for Rama. With such love & awareness also comes the understanding that both are as One.
Focused on the Divine presence within we realize we are the giver and receiver of love—the lover and the beloved—in one. This is the blossoming of perfect wisdom (prajna), the clear perception of the enlightened state. We discover we are all that exists. We are one appearing as many and able to give ourselves fully to love because we realize there is no possibility to be hurt in this inner union.
TL;DR: Upon seeing Rama's glory, Hanuman instantly felt faith in & love for Rama. These lead Hanuman to remember what he had forgotten: Rama is Viṣnu & Hanuman is Shiva and they are One. This realization further multiplied his love & devotion.