friend said:
Dark energy is still energy so couldn't it also gravitate?
It does--but the way it gravitates is different from the way ordinary matter and energy gravitates.
Heuristically, the general quantity that determines how something gravitates is ##\rho + 3 p##, where ##\rho## is the energy density and ##p## is the pressure. (This is actually only true for something that can be modeled as a perfect fluid, but that's a good enough approximation for this discussion.) For ordinary "cold" matter (including dark matter), ##p = 0##, so we just have ##\rho##, the energy density; this produces the ordinary kind of "gravitation" that we associate with ordinary matter like planets and stars.
Radiation (for example, the CMBR) has ##p = \rho / 3##, so heuristically, it "gravitates" twice as much as you would expect from just its energy density. That affects how the expansion rate changes with time in the early universe, because the early universe was dominated by radiation, not cold matter. However, today, and in the future, radiation is negligible since its energy density is so low (because its energy density decreases faster with expansion than the energy density of cold matter does).
Dark energy has ##p = - \rho##. That means that the "gravitating" quantity, ##\rho + 3p##, is
negative (it is ##- 2 \rho##). So dark energy produces "gravity" that is repulsive, not attractive--it makes free-falling objects move
apart, not
together. That is why dark energy causes the expansion of the universe to accelerate.