You don't have to pay them unless the court grants her request. That's a very common request, but I don't believe it's granted all that often in routine divorces. More commonly, it would be granted if one party starts making ridiculous filings after the divorce is final.
Or makes ridiculous filings that drive up the attorney fees
during the divorce.
There have been some highly publicized cases like that, although they are not the norm.
I know of one guy that got hooked up with a militant father's right's group, and hired an attorney recommended by them, and he got really totalled financially. He ended up with over 100k in legal fees himself, and was ordered to pay 60k of mom's legal fees.
I really felt sorry for the guy. You would have too if you had read any of the motions his attorney filed. They all harked back to over 100 years ago when women and children were the "chattal" of the husband.