According to Android definitions, I've found that:
Resolution: The total number of physical pixels on a screen
Density: Based on the screen resolution, the spread of pixels across the physical width and height of the screen.
How can I understand better the differences between the two definitions?
Resolution is about how many pixels you can show on screen.
Density is based on your device real size, if it's small and has a higher resolution, than the density is high cause you show more pixels in less physical space.