Children audiences can be some of most grueling, demanding, nerve racking, types of crowds to entertain.
Seconded. There are three major reasons for this.
1. Children don't have the focus to follow complex plots yet. That's not to say that they can't follow at all, but they need to be more engaged because they haven't had the time to learn patience yet. You don't do a complicated, involved, multi-phase routine for kids for the same reason you don't ask those same kids to sit down and try to watch a Bergman film.
2. Children tend to be more outspoken and don't have as good a grasp on etiquette when it comes to entertainers and speakers yet. For the most part, they don't quite get what is inappropriate to do during someone's act and why that's bad.
3. They don't take things for granted the way adults do. People say that kids are simple and pure. Wrong. They're not half-formed adults. They're thinking, sentient beings for whom the impossible is strictly a matter of patience. The ideas they come up with may be outlandish to adults, but the child is following their own consistent internal logic, even if the rules they establish seem to be vague at best to everyone else.
All this adds up to the inescapable truth that kids can be very difficult to manage because they don't have enough social experience to understand how to be courteous to a performer the way adults are (or at least should be) and the explanations they come up with for magic are almost certainly going to be more inventive than yours.
I'm not saying that learning how to crowd control kids and entertain them wouldn't be rewarding, it's just that they seem to be very relentless when trying to understand what you are doing. Like when they go for two hours simply asking 'why'.
That's what they're neurologically programmed to do. Human beings spend the first quarter of our lives trying to vacuum in as much knowledge as possible. In the span of 18 years we're expected to learn not only our motor skills, but also written and spoken language, social dynamics, how our society functions, abstract concepts of philosophy and art, and so and so forth. This is why kids' imaginations are so vivid. They have to be to facilitate that much learning in less than 2 decades.
Now to answer the question. Laughter as a biological mechanism is about relieving tension. When you laugh, it releases endorphins that soothe and relax you. After you get a huge scare or are startled, you usually laugh it off after the tension has passed specifically because you're trying to calm yourself. Laughter is also the response to a pattern break. A well-timed, well-executed non sequitur makes us laugh because pattern breaks are typically cause for alarm or a sign that something is wrong. We laugh reflexively to keep from getting freaked out.* Think about it, what is the most basic structure of a joke? Setup, setup, punchline.
On top of that, a lot of humor stems from misfortune. Someone else's. A children's performer has to be completely unafraid to make himself the butt of his own jokes every now and again. Reality1 comes around here sometimes and is an experienced children's magician. Look up some of his anecdotes. There are times when he structures the show so that the kids see what's going on, but he appears oblivious. Children are shouting at him and he keeps going on. The kids think it's hilarious.
The point is that the jokes have to be unpretentious and uncomplicated, take time to build up the suspense, then hit them with the punchline. The timing is the hardest part and that comes mainly with practice and experience. You build up your sense of timing through intuition. Don't be afraid to make yourself look foolish now and again. It's not like the parents hiring you are actually going to think you're an idiot, they know it's an act you put on to make the kids happy.
And on top of all that, the jokes have to allow interaction with the audience. There has to be room for the kids to shout at you. Because they will. You have to be prepared for one or more of them to rush your "stage" thinking they can either catch a mistake or help you. Because they will. Your job is to keep them entertained and engaged. Don't offer explanations. Let them shout their theories. Stick to your structure, but pay attention to their reactions to see if you need to speed things up or just cut to the punchline.
*Do not mistake this to be an endorsement of "random" humor, because that is never funny. It's just lazy.