After a few years, dirt settles on the heat exchanger. The dirt traps water in pockets. As the fire plays upon the heat exchanger, the water in the pockets turns to steam and it is forced out of the hole to collapse in the cool water. The collapse slams water together at high speed. The more pockets, the more pops.
You might be able to have the bottom flushed of the sediment, you might not be able to and require a new heater.