Hanuman was a loyal follower of Rama and worshipped him wholeheartedly. One day, Sita gave him a precious pearl necklace. Hanuman immediately broke the necklace and started looking at each pearl carefully. He glared at each pearl and threw them away, one by one, in disgust. Sita was surprised and asked him for an explanation.
Hanuman explained that he was looking for Rama's image in the pearls. Hanuman believed that Rama was present everywhere and was disappointed that he could not find his image in the pearls. He declared the pearls were just stones and pebbles and thus, were worthless. When the people around him asked if Rama was present in Hanuman, Hanuman tore open his chest with his hands and everyone was amazed to see a brilliant image of Rama and Sita engraved in his heart.
The people accepted that Hanuman was a true devotee of Rama. This is why he is also known as Bhakta Hanuman.