Ravan was very proud of his might. He had the habit of challenging anyone who was called as very powerful. He once challenged Karthviryarjun and was easily defeated. Still, his pride knew no bounds. He heard a lot about the might of ape king Vali.
Ravan came to Kiskindha city to challenge Vali for a duel. At that time, Vali had left for southern seas for his prayers. Vali was a devotee of Lord Shiv and used to go to distant places to find a quiet place where he could offer worship to Shiv without any disturbance.
Vali's younger brother Sugriv, son Angad, father-in-law Sushen, and a minister named Taar informed to Ravan that Vali had gone for his prayers.
They mocked by saying to Ravan, "Wait here till Vali comes back. Or, you are free to fly to the southern seas yourself, if you are in a hurry to breathe your last a bit too soon."
Since Sugriv was one of those who said like this to Ravan, this means that this incident occured before the animosity between Vali and Sugriv started.
By his Pushpak Viman, Ravan went to the shore of southern seas where Vali was doing prayers. Ravan went towards Vali with silent steps. Ravan decided to tie Vali. Vali somehow sensed Ravan's presence. He captured Ravan with his tail and then clapsed him in his armpit. After that he went to other seas and offered prayers there. All this while, Ravan was helplessly clapsed in Vali's armpit.
After finishing his prayers, Vali went to his city Kiskindha. There, he released Ravan from his grasp and said, "I am sorry. Since, I was very busy, I could not ask you the purpose of your visit. Now, please tell me why you wanted to meet me."
Ravan was amazed at Vali's strength. He did not know that somebody can be so powerful that he can capture mighty Ravan in his hand and fly long distances.
Ravan said to Vali, "O king of monkeys. I am a compeer of the mighty Indra. I came here seeking an encounter with you and you captured me today. Wonderful is your strength. By you, I was taken like an animal round the four seas. Having witnessed your might, I wish to enter into an enduring and exceedingly loving friendshop with you in the presence of fire."
Then Vali and Ravan became very good friends with fire as witness (because presence of fire is considered auspicious).
Ravan stayed in Kiskindha for about a month. Vali gave as much importance to Ravan as he gave Sugriv. After one month, Ravan's ministers came there and requested Ravan to come back to Lanka. Then, Ravan went to Lanka.