It depends upon the age of the child. If the child is a toddler, they simply need to be told that the other parent is not available or can't be home at this time, that they are staying somewhere else and cannot be seen.
A child between the ages of 5-10 needs more explanation, such as that the other parent cannot be near because they did something that was against the law. The details of the incident need not be disclosed. They do need to know that the police should be notified if the person comes near, and that they need to be careful. Arrangements should be made for them to be in contact with the other parent in ways where they would not be exposed to danger.
Children older than age 10 need enough information to know that pain was inflicted, and in order to prevent further pain, the restraining order is put in place. They need to understand that caution should be exercised (what behaviors to watch for) and that police should be notified if the order is violated. Details of the pain inflicted need not be disclosed. Arrangements for them to see the other parent in the presence of monitors should be made.