Don't have kids but have observed the raising of a bunch in and around horses.
The key to success IMVHO is having clear unbreakable rules- no exceptions, no slacking on them, no exceptions ever. Once they learn the rule is absolute (no running near them, never walk behind them, never enter the pasture with permission/an adult, don't enter arena without permission if someone is riding, etc), they will treat it as such, even pretty young ones. My current BO's kids learned these rules from Day1 and it shows
There is something about the outside of a horse that is good for the inside of a man.(Churchill)
I think I've read elsewhere that people have converted one stall to a play room (that kids can't climb out of!) and I'm thinking of something similar with one of the outdoor pens for a few years. This will have the added benefit of naturally forcing me to acquire one less horse!
Instead of giving up a stall... one place I took lessons had a chain link dog pen set up beside the barn (visible from the arena) as a play house-- play stove, sand box, etc.
[Some people will flip out at the idea of putting a kid in a "cage" ... but is it *that* different from the play pen you stick younger kids in?]
As I was there to ride, I thought it did a great job of keeping the kids contained and occupied (read: QUIET) where their parents could see them.
We never fenced in our child. We put up enough no climb fencing to stop him from getting into paddocks and pastures. Then, we set up an area for him to be in front of where the horses are tied up. We taught him never to go behind the horses. That was amended when started caring for his pony. He can go around behind very close to her with his hand on her. He helps clean and feed the horses and he knows how to feed them treats properly. He is four years old.
My niece was fenced in while her mom taught riding lessons. It didn't feel right for us. I don't depend on horses for my livelihood and I don't get any riding done unless my hubby is watching our son, but, soon enough, we'll be on the trails together.
We raised our daughter while maintaining a TB racing stable and a training facility at home. I think the one most important criteria is to have a child who MINDS!!! When you tell a kid to STAY where they are (in a safe location) they should stay there...no if, ands, or buts!!! While at the race track we had a heated, cooled office where my daughter had her toys and a cot if she wanted/needed a nap. In decent weather there was a half door stall screen across the door so she could see everything that was going on. After training hours were over she was allowed to be in the shedrow area, but NEVER allowed to approach the horses or enter any stalls unless we were with her. She never violated our trust in her or was never injured in any way. If a child is not trustworthy to obey rules...they are not safe in a stable/horse situation.
Our daughter no only survived unscathed, but grew into a fine rider and horsewoman. "IT" can be done.
My kids have their own kids now so I am again watching out for little ones around my barn lol. I am agreed with the majority here, I never let my grandkids anywhere near the horses when they are loose. Also, as somebody mentioned water tanks can be very dangerous for very little ones but something nobody else mentioned is hay. Be careful when your kids play on high stacks of hay, either squares of round bales. A 5 yr old suffocated a few years ago when he went down in between some rounds and they could not get him out in time. Freaky, yes, but I had never even considered that possibility before then.
You know how schools have practice fire drills? We have practice emergency drills at the barn. Older DD is 11, younger is 8, and if I yell "Get on the wall, heads upl!" (as in, head to a wall or stall front asap, some horse is acting up somewhere or has gotten loose) they still know that for their safety, they need to do that.
"And now," cried Max, "let the wild rumpus start!"