Part of it is certainly teaching children to be charitable and to have empathy for others. Many people consider that important, and teach their children by setting a good example and getting them in the habit of giving charitably, whether it's through donation jars, "save spend give" allowances, or this kind of thing. And giving directly to someone, as opposed to putting coins in a jar at the store or something similarly distant, can be quite helpful. From a Parenting article about charitable giving, for example:
[I]t gives kids a powerful boost in self-esteem to realize they can make a difference in someone's life
"It's hard for kids to grasp that the money is going to, say, buy bread, which in turn will help feed ten homeless people," says Spaide [a founder of a children's charitable organization]. "Many children can't take the process that many steps forward in their minds."
Giving money directly to someone who needs it makes that much more concrete, and helps them see the benefit at a level they can understand.
Separate from the charitable side of things, though, some of it also is that children like to have something "to do", and giving them that role (of actually handing the money to the performer) is nice for the children. They get to feel a sense of involvement. This is no different than when we go to Costco and I hand my son the receipt at the end, to show the checker at the exit, for example.