First thing, you need to get her checked by a vet for anything that might cause her pain. Arthritis, a herniated disk or certain vitamin deficits are known to cause pain and dogs that are in pain are known to bite. The children might have touched her in a way that caused her pain and she bit in reaction to that.
If the vet doesn't find anything, you need to take into consideration that she'll never be a safe dog. I, too, have a dog that was abused as a puppy and he can never be trusted around men. Your dog cannot be trusted around anyone, so don't trust her not to bite. There are certain muzzles that are designed to be worn a long time, allow the dog to pant and drink and eat. She should wear it every time you have guests or when she's unsupervised around people.
Can she understand that she's not allowed to play because she bites? No.
Can she understand that she's not being punished? No.
Can she understand why she's in a muzzle? No.
Dogs are intelligent enough to connect certain stimuli with certain outcomes, like you holding the leash means she's going to go on a walk. They are not intelligent enough to understand complex social rules like if she would stop biting she could play with the children. However, she could learn that having a guest at your house means she wears a muzzle without her feeling punished.
Usually, you would train with her that if she does something you don't want it has consequences she doesn't want. But since her unwanted behavior causes real injuries, you cannot wait for her to bite another person to train with her not to bite.
There's also the real possibility that in the moment she bites, her brain switched to a "fight or flight" mode. This is an evolutionary mechanism to protect her in dangerous situations (like a fight with another dog) but at the same time it deactivates her ability to analyze a situation and learn from it. When she was abused in the past and something reminds her of that time, it triggers this "fight or flight" reaction and she cannot be held accountable for her actions.
The same happens to my own dog, who was abused in the past. His trigger is someone leaning over another person or him (and it took us a year to finally realize the specific trigger). When I want to show someone something on my phone and lean down to them, he perceives this as intimidating and dangerous and immediately starts attacking me without any warning at all. We're just lucky that he doesn't actually bite. We tried training with him his whole life, but the only thing that really improved the situation was him going blind and being unable to see the triggering body posture.
The most important fact is that if your dog is triggered, you must not, under any circumstances, cause her pain. If the attack is caused by past abuse, you can only make the reaction worse by causing her more pain.
Instead, you should remove the dog from the situation and lock her into a safe room until she calmed down. This safe room can also be a crate where no one bothers or interacts with her and she can calm down.
The topic of abuse and trauma is a very complex one, so please read a lot and try to understand the mindset of your dog. Some sources I find helpful are:
To summarize the most important tips from those links:
- Create a safe space for your dog where nothing bad ever happens. This can be a crate, a dog house, a certain room or a dedicated corner in a room where the dog bed is. Whenever your dog is triggered, bring her to this safe room.
- End the traumatic situation on a positive note. This certainly seems counter-intuitive at first, but when you are removing her from the triggering situation, don't scold or reprimand her and don't cause her pain. Once you have brought her into her safe room, give her a treat. This makes the triggering situation less terrifying.
- Identify her trigger. It's best to keep a note or a journal lying around where you can take note about what happened right before she started biting. Hopefully over time a pattern will emerge that makes you understand her trigger and ultimately avoid it.
- Give her autonomy and choices. Keeping her leashed to the fence is a sure way to traumatize her even further. She needs to feel safe and like she has a say in what happens to her and in her life.
- Let it go. Don't pity your dog all the time for her past abuse. It's over now. She has a better life with you. Treat her like any other "normal" dog (but keeping her triggers in mind) and be happy that she's happy now.
To avoid her triggers, you'll need to set rules not only for your dog, but also for all guests who interact with her. If you notice that she bites when she's touched on the head, make a rule that no one is allowed to touch or pet her head. If you notice that she bites when she's being touched when she doesn't expect it, make a rule that anyone who wants to pet her has to ask "may I pet you?" before touching her.
And 2 personal recommendations:
Your dog is a working breed and probably has a lot of energy. Pent up energy can increase anxiety and panic reactions. Please have a look at this list of dog activities and try to incorporate some of those into your life. Something as simple as a puzzle feeder doesn't take much of your time but helps your dog be more relaxed and balanced.
I do believe you when you say you know the difference between an aggressive bite and a playful nip, but dogs have an incredible number of warning signs before they start biting. It's very possible that abused dogs don't give warning signs before attacking, but maybe you can still see and identify some warnings. Please have a look at these questions for references and video tutorials: