Phyiscs and cosmology of dark energy