I don't think anyone has the foggiest yet. Probably the other way round, in some sense -- i.e. dark energy is just inverted gravity, but there's no consensus on this.
Have you ever done integral calculus? If so, here's a simple-ish way to explain how dark energy might arise.
Whenever anyone talks about equations for just about anything in physics they nearly always mean equations of a form:
rate of change of quantity X = something else.
The rate of change bit implies differentiation, so that if you were ever going to solve these equations you'd have to integrate at some point. The general form is then:
X = integral of something
If you have done integration then you will remember that if we don't have any specific boundary conditions then you have to write something like:
integral of x = (1/2)x^2 + constant
and in A-level exams people lose marks just for forgetting to put "+ c" on the end of their results! It's annoying, anyway, to remember, but has to appear, as whenever you differentiate just a number you get zero. And as integration is the inverse of differentiation you must remember to add the number on.
Now of course in General Relativity we are dealing with four-dimensional space time but the basic form of the equations is essentially the same, i.e rate of change of space and time is given by the distribution of energy and mass in the Universe ("matter bends space, and this is how" is effectively all the equations say).
We can differentiate the equations of general relativity once more. Unsurprisingly the amount of energy and matter in the Universe is assumed to be constant -- where else can it go? -- so one side vanishes completely and so the other side must also vanish. But then we have a law that says basically:
Overall "rate of change" of the curvature = zero
This is a law that we can then integrate back up, but in doing so we have to allow for that "+ constant" again. A more complicated "+constant", but the same idea. You have to allow for it for the equations of General Relativity to be in their most general form. In fact this "+constant" is just the cosmological constant that is believed to be the driving force for dark energy.