There are various types of hot water heaters on the market today. All of them obviously are for the same purpose of heating your hot water, but each has it's own application where it should be installed.
Standard Hot Water Heater
This type of hot water heater can be fueled by gas, propane, oil or electric. Inside the tank, there are elements that heat your water constantly to a certain temperature. In some situations where there is a high volume of hot water needed, a second tank may be added as a storage tank. Both of these tanks will hold the amount of water contained at the set temperature. As it is used, the tank will need to refill and reheat. This process is much slower in an electric application vs. gas, propane or oil.
Tankless on demand water heaters are just that. They do not have a holding tank and provide hot water only "on demand". These hot water heaters work in some situations, however tend to be much more costly and do require maintenance on a monthly basis as particles from the water can easily clog the system.