Hey I'm writing my thesis on Behavioural Ecology and have an answer for you! Tbh I work w bugs but I'm a big fan of amphibians so I dabble ;)
Before fighting, these frogs tried to resolve their differences peacefully with shouting. Usually, you can tell from the sound of the call which frog is bigger (and thus presumably stronger). Bigger frogs generally have deeper, louder calls, and if the other frog is significantly smaller, they'll often just give up and leave without a fight on the basis of a rival's call alone. It's kind of hilarious, actually: if you take 2 fairly even frogs, and modulate one of their calls to make them sound bigger, the other one will often just dip. Like "no, that guy sounds like he could kick my ass, I'm not touching that!"
So the first bit, they're calling close to each other, simultaneously to attract a female and to size each other up, but after a while they realise that they're pretty evenly matched. If a lady shows up, she might pick either one! Can't have that. Plus, maybe this is a great spot! The acoustics are EXCELLENT, and the call reflecting off this concrete wall makes me sound even BIGGER and STRONGER, but this other dude is RUINING it. Only solution is to declare this territory as my own and kick out the other guy!
Basically, there comes a point where yelling isn't enough and the frogs need to fight it out to determine who's the strongest. Even then, it tends to be a strength test more than a trying-to-hurt-you fight (think arm wrestle vs fist fight in humans). The stronger one pushes the weaker one, the weaker one realises he's outmatched, and he leaves with no one sporting any significant injuries other than on their frog-pride (which may or may not exist, idk if frogs feel thinks like "pride" or "envy." P sure they experience "avarice" tho).
You see similar things in lots of animal species. It's called "Ritualised Aggression" if you want to google it more! Honestly there are some EXCELLENT examples out there.