If the sons of Korach joined their father in the plot against Moshe, why did they not die?
Targum Yonasan: 'The sons of Korach did not participate in their father's plot (because) they followed the teachings of Moshe the Navi. Therefore, neither were they burned by the fire nor were they swallowed up by the earth.
See Sifsei Chachamim.
Rashi (in Tehilim, 42:1): ' ... their location remained intact inside the mouth of the earth, where they said Shirah, and that is where they established the current Psalms (42-49). Eventually, they emerged from there; Ru'ach ha'Kodesh rested upon them and they prophesied on the Galus, on the Churban Beis-Hamikdash and on Malchus Beis David'. (It is not clear however, why their Teshuvah did not save them from being punished at all).