When Einstein wrote The General Theory of Relativity, he assumed that gravity acting alone would mean a contracting Universe, so he included in his theory a cosmological constant which would oppose the force of gravity and could mean a Universe which did not contract. Later however, the expansion of the Universe was discovered and the cosmological constant was discarded.
Lately however, observation of distant galaxies implies that the Universe is speeding up, and Einstein's cosmological constant has been resurrected.
The physical origin of the constant are unclear, but could lie in the vacuum pressure of space – space is not empty. It is full of virtual particles which exert a pressure and have energy, behaving in many ways like the hypothesised dark energy.