I can only speak from what I personally know, but times are changing. More fathers are being awarded custody these days. Mothers are still the majority, but a father stands a better chance at custody now than even 10 years ago.
For example, my husband has 3 children from his previous marriage. He was awarded custody from the start. When him and his ex-wife split, he went down and filed for custody. It was honestly that easy. We have all 3 children living in our home full time.
The rules vary from state to state, but if you leave the marriage with your kids in tow, you file for custody, and can prove that the children have been in your care the full length of the separation, you stand a better chance at keeping the children in your care.
To answer your question: "What makes the mother a better parent than the father?" the answer is nothing. There are just as many "dead beat" moms as there are "dead beat" dads. I deal with a "mother" on a regular basis that frequently puts her own needs in front of her childrens needs, even if those needs interfere with the safety and well-being of the children she gave birth to.
In my own opinion, gender is not what makes a parent. The heart of the parent is what matters. Unfortunately, judges are unable to take the time to see which parent will be a better choice and frequently "default" to award custody of the child to the mother, as "mothers," are supposed to be the nurturing type, although that's not always the case.