They must have done a good deed to be experienced as pleasant either previously or later, or else at the time of death they undertook Right View. And that’s why, when their body broke up, after death, they were reborn in a good place, a heavenly realm.

When Samiddhi presented an poorly distilled summary of the Buddha’s teachings to an outsider (saying that all deeds ultimately result in suffering), the Buddha corrected him by emphasizing the nuances of how karma can play out over multiple lifetimes.