Shabbos, Perek Kirah, Mishnah 6. The Mishnah deals with a fire that broke out on Shabbos in a Jew's property, and with the question of how to act when someone else comes to put it out - a non-Jew or a Jewish child.
A non-Jew who comes to extinguish:
One may not say to him "put it out," since that is telling a non-Jew to do melachah, which is not permitted, and a Jew has no license to cause a non-Jew to perform the work on his behalf. However, one is also not required to say to him "do not put it out"; rather, one is permitted to let him be: if he wishes to extinguish, let him extinguish. The Gemara goes even further and permits saying "kol hamechabeh eino mafsid" - whoever extinguishes will not lose out, provided that this is not a direct instruction to perform the melachah.
What is the reason for this leniency? Because we bear no responsibility to ensure that non-Jews keep Shabbos, since they are not commanded in its observance.
A Jewish child who comes to extinguish:
Regarding a Jewish child who wants to go and put out the fire - "ein shom'in lo" - we do not listen to him, and we do not allow him to do so, because his resting on Shabbos is incumbent upon us, and it is our responsibility to make sure that he rests.
The Gemara notes that as a rule the halachah is that when a child eats something forbidden, beis din is not obligated to stop him, since he does the improper act on his own initiative and for his own sake. Here, however, we are dealing with a child who performs the melachah knowing that he is doing a favor for his father and parents; and since he knows that his father wants this done, it turns out that he is doing it for his father, and in such a case there is an obligation to stop him.
By contrast, with a non-Jew, even though he is extinguishing for the Jew's benefit, as long as he was not instructed to do so by the Jew's own mouth, it is permitted.
In summary: In this Mishnah we learned the distinction between a non-Jew and a child regarding extinguishing a fire on Shabbos: to a non-Jew one does not say "put it out," because of the prohibition of telling a non-Jew to do melachah, but there is no obligation to hold him back, and it is even permitted to say "whoever extinguishes will not lose out," since his resting on Shabbos is not our responsibility; whereas with a Jewish child, "ein shom'in lo," we do not listen to him, because his resting is our responsibility, and especially here, where he extinguishes knowing that he is doing so for his father's benefit, and therefore we are obligated to prevent him.