How does pressure relate to cosmological expansion? In my cosmology class, we've been talking about pressure in the Friedmann Equation for acceleration:
$$
\frac{\ddot{a}}{a}=-\frac{4 \pi G}{3} \left(\rho+\frac{3p}{c^2} \right)
$$
In particular, I've been a bit hung up on this passage in the textbook:

Notice that if the material has any pressure, this increases the gravitational force, and so further decelerates the expansion. I remind you that there are no forces associated with pressure in an isotropic Universe, as there are no pressure gradients.

How, physically, does pressure do work decelerating expansion if there is no pressure gradient or forces involved? How can pressure affect any of the properties of spacetime?
 A: The point is that pressure is a source of gravity in GR. In other words there are (often weird) gravitational effects of pressure in addition to the normal effects of pressure you are familiar with from fluids. There is no way to get intuition about these gravitational effects from your normal experience, it's purely relativistic. Indeed, in cosmology, 'dust'--or non-relativistic matter--has w=0 (really w is just very very small), so the pressure of non-relativistic matter is not enough to have any significant gravitational effect.
In your example, it's not that pressure is doing work in the normal sense of pushing the walls of a piston, it's that the pressure creates a gravitational field that does work. Having said that, you do have to be careful talking about work and energy here, because energy is not (globally) conserved in GR, and the concept of work isn't as useful.
In many cases, gravity responds to pressure in a way that is counter to your intuition derived from fluids. For example, the cosmological constant can be thought of as a kind of fluid with negative pressure. In daily life, negative pressure means tension--rubber bands have lots of negative pressure. A stretched rubber band has a pressure gradient at the boundary of the rubber band, and this pressure gradient causes the band to be pulled back to equilibrium. But gravity responds to negative pressure in exactly the opposite way. A cosmological constant causes the universe to accelerate! It acts to push things apart from each other.
It is not hard to see at a heuristic level how Newtonian gravity + special relativity  leads to momentum (and thus pressure) being a source of gravity. Newtonian gravity says that mass is a source of gravity. But mass and energy are interchangeable in Special Relativity, so energy should gravitate as well. But energy is not invariant under boosts--what I call energy in one frame I will call momentum in another. So gravity must also respond to momentum. The pressure of a gas of particles comes from the momentum of the particles that make it up, and so pressure gravitates.
