It's a slightly complicated topic, but let me try to explain, bi'ithnillah. We'll leave the courts and legal structure aside for the moment, ultimately the matter is between the husband and wife. The legal institutions only seek to aid the process, they're not a requirement for it to work (Islamically speaking).
Firstly, divorce. This is only possible from the husband, women cannot divorce. All that the husband needs to do is tell the wife that he is divorcing her, and that's it, the talaq is initiated. He needs to do it though when she is pure (i.e. not on her cycle) and in a period of purity where he has not touched her (in the marital sense), i.e. if they've not been together in a marital sense since she came off her cycle, he's able to initiate talaq.
Her iddah (waiting period) is three menstrual cycles. Once she completes the third cycle, she is completely free from him. If this was the first or second talaq, she has to stay in his home (because she's still his wife until the iddah period expires, and she's supposed to beautify herself to try and get him to take her back, and give him the chance to revoke his divorce). He can revoke the divorce at any point before the iddah ends, and the marriage continues as per normal.
If it was the third time he's pronounced divorce, she is no longer his wife with immediate effect (because he can't revoke the third divorce, it's pretty much final). She should wear hijab and leave the home. She still has the iddah of 3 cycles to wait before she can accept proposals, etc, but in terms of other obligations towards each other, they all end.
When the husband calls for a divorce, he can't ask for anything in return. The mahr he has promised his wife becomes due upon him (i.e. he has to pay it to her, unless she agrees to waive it, but he's not in a bargaining position... it's her right!)
With regards to the wife wanting to end a marriage, she has the option of a khula, whereby she ransoms herself off. The husband and wife agree a mutual amount between them, she pays that to him and as soon as the transaction is complete, she's free of him. She has to wait for one menstrual cycle before she can pursue other proposals, just to ensure she's not pregnant. It's generally believed she has to give the mahr back, but in reality the amount can be anything the two of them agree between themselves - so it can be the mahr amount, or more, or less.
And as always, Allah (swt) knows best