It's a sad fact of life that, in modern times, a large number of relationships break down and marriages end in divorce. In the aftermath this often leads to children being raised in single parent families. Generally any children from failed relationship would continue to live with their mother, although this is a social normality and not something that is determined by the courts as part of routine divorce proceedings. However, custody of the offspring may be contested in court, resulting in a residency order granting the father (or mother) custody of the child(ren). It may also be the case that the father is the main carer because both parents amicably agree that it's for the best, or the mother may have unfortunately passed away.
Subsequent relationships may lead to further children which can create an undesirable situation whereby the new children have a different surname (that of the new partner) from their step brothers or sisters. This is particularly likely if the mother has married her new partner and taken his surname. Even if the mother doesn't give birth to anymore children, she may wish to change her own surname back to her maiden name. This could be because her previous relationship ended under unpleasant circumstances or just purely out of personal preference.