The paths of Adam and Iblis
“If people become like Adam (peace be upon him), admit their sins, ask for forgiveness, regret their deeds and stop disobeying the Lord, then He makes them his chosen ones and instructs them on the straight path. But if they become like Iblis, committing sins and multiplying their wickedness, then Allah removes them from himself. “
See Tafsir al-Sa’di 1/886