"schmecken" is one of the few verbs that takes a dative object instead of an accusative object. The person or animal who finds something tasty is in the dative case, whereas the food/drink that is found tasty is in the nominative case since it is the subject of the clause, e.g.

 

Schmeckt

dir

das Essen?

Do you like the food? [Is the food tasty to you?]

verb

dative object

subject

 

In the riddle, "allen Kindern" is the dative object.