Detailed explanation hit wikipedia.
Simple explanation (no flames for 95% right information that blurs the last 5%) :
DDR is a kind of Memory. The terms DDR3, DDR4 etc. only every refer to memory. Memory is fast short term storage for data that comes from your disk or from the internet. When you power off data is memory is lost.
The number on DDR, e.g. the 3 in DDR3, refer to the generation of memory. All ddr 3 memory works roughly the same, DDR4 is an incompatible break from DDR3. All DDR4 memory works the same.
The Motherboard or lately the CPU have "memory controllers" that must understand what kind of DDR memory is being used. Some configs support DDR3, some support DDR4, some support both.
DDR4 is faster...