Energy density is how much energy a battery stores for its size or weight. It is usually given in watt-hours per liter, for volume, or watt-hours per kilogram, for weight. A higher figure means more energy in the same space or mass.
It matters for phones and other portable devices, where space is tight. Higher energy density lets a maker fit a larger capacity in the same body, or keep the same capacity in a thinner one.
The figure is not a full measure of quality. Gains can come with trade-offs such as shorter cycle life, slower charging, more heat or higher cost, and the way density is calculated, for example for the cell alone or the whole battery pack, can change the number. A battery with higher density also does not guarantee longer use between charges, since that depends on how the device uses power.
When comparing, check whether the figure is for the cell or the pack, look at capacity in watt-hours and consider cycle life and charging behavior alongside it.