Often the best way to illustrate how something works is through a little play acting.
The mother seriously injures the child. The father takes the child for medical attention, the court puts an order in place so that the father cant take the child for any more medical attention or treatment. The court then accuses the father of trying to alienate the child from the mother. The court gives the mother full sole custody and the father a no contact order.