In Ramayana, during the search of Sita ma, Jambavan Ji reminded hanuman ji of his powers and thus freed him from the curse he got in young age.
But how did he know of that incident?
We can only use inference from Ramayana as there is no direct mention from Jambavan ji about how he knew full story of hanuman.
We can definitely say Jambavan is the oldest and wisest of all the warriors as he circumambulated vamana avathar 21 times.
trivikramē mayā tāta saśailavanakānanā.
trissaptakṛtvaḥ pṛthivī parikrāntā pradakṣiṇam৷৷4.66.32৷৷
'O dear! when Visnu (Vamana incarnate) took three strides I circumambulated the whole earth including its mountains and trees twentyone times.
tathā cauṣadhayō.smābhissañcitā dēvaśāsanāt.
niṣpannamamṛtaṅ yābhistadāsīnnō mahadbalam৷৷4.66.33৷৷
'Then on receiving orders from the gods, we collected medicinal herbs and nectar which gave us great strength.
As he was there from the beginning he would definitely know the full story of Hanuman and is waiting for the right time to recite the same to Hanuman.