why do water heaters leak
It is possible that there is nothing wrong with your water heater. There is a pressure relief valve on top that may be releasing water because your primary water pressure reduction valve for the house is worn out. The fact that the leak is intermittent suggests this.