What, according to you, makes the two adversaries turn into good friends in matter of minutes? Explain it as you have understood it.
Both of them realise that neither of them can win the fight. then they find certain skills in each other, which they themselves not have. When the other boy see how well Ranji dived and swam underwater he forget about the fight and ask him to teach him this swimming skill. Ranji's willingness to help the other boy made their friendship possible, and in this way the adversaries turned into good friends.