And in case that excellent mathematical answer still leaves you some questions about the basic physics at a more descriptive level, I would point out that in general relativity, gravity does not just come from rest mass (and hence rest energy), it also comes from pressure. Usually the pressure contribution is negligible-- like the way the pressure of the Sun contributes to its gravity is totally swamped by the way its rest mass contributes to its gravity. But that's because the Sun is mostly nonrelativistic gas-- vacuum energy would be working in a highly relativistic way, whatever is causing it. Now, in unusual situations (like with vacuum energy), pressure can not only be important to gravity, it can be related to energy in weird ways-- in particular, it can be negative when the energy is positive!
The reason for this is that pressure is basically how much energy you can remove from a system when you expand it a given tiny amount, but to expand vacuum, it requires more vacuum-- which if vacuum holds energy, requires that you add energy! So you don't extract energy when vacuum expands, you need to add it instead. That means the pressure of vacuum is negative if there is vacuum energy, and that means its gravity is negative too (or "antigravity"). So two masses placed far enough apart actually experience a kind of repulsion-- due to the vacuum between them (using the cosmological constant model-- so simple vacuum energy).
Now, normally this requires a whole lot of vacuum to be in there, so perhaps this is why we are just now starting to see this effect in our expanding universe (the accelerated expansion phase that is just getting going). But if there was a very early phase of the universe where there was a huge energy associated with a "false vacuum", then even with dense positive pressure there could be a huge negative pressure component, just for a short while, that could have created the inflation. After the false vacuum "decayed", it no longer had that huge antigravity, and the normal gravity of all the positive pressure and rest mass would have taken over, until the recent era of acceleration.