Energy density is the amount of energy in a given mass (or volume) and power density is the amount of power in a given mass. The distinction between the two is similar to the difference between Energy and power. Batteries have a higher energy density than capacitors, but a capacitor has a higher power density than a battery. This difference comes from batteries being able to store more energy, but capacitors can give off energy more quickly.
If a system has a high energy density then it is able to store a lot of energy in a small amount of mass. A high energy density does not necessarily mean a high power density. An object with a high energy density, but low power density can perform work for a relatively long period of time. An example of this type of energy storage is a mobile phone. Its power will last most of the day, but to recharge the device, it must be connected to another power source for an hour or more.
If a system has a high power density, than it can output large amounts of energy based on its mass. For example, a tiny capacitor may have the same power output as a large battery. However, since the capacitor is so much smaller, it has a higher power density. Since they release their energy quickly, high power density systems can also recharge quickly. An example application of this type of energy storage is a camera flash. It has to be small enough to fit inside the camera (or cell phone) but have a high enough power output to light up the subject of your photo. this makes a system with a high power density ideal.
To better understand energy density, consider people lighting a fire while out camping. Evening has come, and it's time for S'mores, so it is time to build a fire. Naturally, the fire is first lit with kindling. It's high surface area-to-volume ratio means that it burns quickly—a high power density. Once the fire is going, kindling isn't a good fuel choice anymore, because it burns too fast. Now the fire burns better with logs because they have have a high energy density. A single log burns well for a long time.