The inhabitants of Sālā ask the Buddha why some are born after death in places of woe and others in places of joy.
The Buddha explains that it is due to their deeds, good or bad.
M.i.285ff.