So I have been reading about the nature of gravity, and I have become a little confused as to how gravity is produced. In some videos and books, they state that it is the mass of an object that generates gravity. However, others say that it's not so much as mass, but the density of energy/mass in a given volume of space. I don't know if the two ways of looking at it are one in the same or different. Any help on this would be most appreciated.