The case of Gregg v. Georgia came out of an earlier case, Furman v. Georgia, that had been decided in 1972. In that case, the Court decided that the death penalty, as it was being applied at that time, was unconstitutional. The reason for this was that it was not being administered in a rational and fair manner. The Court was not saying that the death penalty was unconstitutional per se, just that it was not being applied fairly.
To remedy that, Georgia redid their death penalty law. The new law was made to be less arbitrary and more rational. You can read the many details of how it did that in the link below. The new law was applied in the case of Troy Gregg. He was sentenced to death and appealed his sentence to the US Supreme Court. The Court upheld the new law.