If you hit the bowl, hungry ghosts will come

A hungry ghost is a demon known as gaki who committed bad deeds during their lifetime and died from starvation. Hungry ghosts are constantly suffering from hunger and thirst, and when they hear the sound of chopsticks tapping a rice bowl, that's their signal for a feast. They come and attack whoever was tapping the bowl, and eat up all their food.

If they feel like staying in the house, they'll eat all the food they can find, and drift silently in the shadows, waiting for the family to bring more food into the house. That will also be eaten before the family has chance, so they will go out and buy more. And so it continues until the family runs out of money and the whole family starves to death.

Children often tap their bowls when waiting to be fed, and to protect them, parents can set up tables outside the house. Food and water is then placed on the table for the gaki to feast on. This custom is followed in some regions during the Obon period.

Verity:

This superstition is to scare children from their bad manners.

Tapping is a sign of impatience; quite natural for humans of any age. Impatience is the restless annoyance from having to wait. Motorists in a hurry but having to stop at traffic lights, tap fingers of the steering wheel, ready to shift into gear to speed away as soon as they can.

Society considers that impatience should be quelled; hence we tell children not to tap the tableware.

But when they're older and start going to bars, they see it's socially expected to tap the table or bar before a shot. It's a custom that many drinkers believe demonstrates respect for the establishment and those who work there.

No hungry ghosts there; only the demon drink. Those drinkers' thoughts are on the liquid spirit.

As for leaving food on a table for ghosts, this is common in many Asian countries, and Western countries too. Just think of the elaborate Harvest Festivals and Thanksgiving Festivals in Christian churches, the Jewish Sukkot and the Muslim Eid-ul-Azha.

Nobody actually believes that God, other deities, ghosts of ancestors or other spirits, actually eat the food. The offerings are acts of gratitude, not superstition, and the produce invariably ends up in food banks for the benefit hungry people.