What causes water to come out of the top of a water heater?

Depends where it is coming from. If it is on the cold side and from the vacuum relief valve, no big deal. If it is coming from the inlet or outlet ports where the fittings are screwed in, then they were not sufficiently threaded in properly.