Einstein wrestled with a problem back before we even knew the universe was expanding, and he was looking for a way to keep the universe from collapsing. And so he discovered, in his theory of gravity, something like this dark energy - he called it a cosmological constant - could play this role, pushing things away.