Both come from rahma, mercy. Translations say “Most Gracious, Most Merciful”, and the difference fades.
The Entirely Merciful, the Especially Merciful.
The commentators explain: both are intensive forms drawn from mercy, and ar-Rahmân is the more intensive.
Look at the shape. Rahmân ends in -ân, like ghadbân, angry, or sakrân, drunk: a word filled to the brim.
Rahîm is on fa'îl, like marîd, sick, or saqîm, ailing: so az-Zamakhsharî sets the two shapes side by side.
Ibn 'Abbâs (may Allah be pleased with him) said it plainly: ar-Rahmân is fa'lân from mercy, Arabic speech.
Az-Zajjâj on ghadbân: the one filled with anger. And, as the grammarians say: more letters, more meaning.
Ghadbân is a man filled with anger, now, to the brim. The -ân shape says a state in full flow.
So ar-Rahmân is mercy pouring out now, at its fullest; ar-Rahîm, the mercy that never stops being His.
Ibn 'Âshûr adds another light: ar-Rahmân says the quality is in Him; ar-Rahîm, that it reaches many.
Al-'Arzamî, an early scholar, put it this way: ar-Rahmân for all creation, ar-Rahîm for the believers.
And ever is He, to the believers, Merciful: rahîm.
A du'â handed down says both in one breath: Rahmân of this world and the next, Rahîm of them both.
Why ar-Rahmân first? Eloquence usually climbs from the weaker word to the stronger. Here the stronger comes first.
Az-Zamakhsharî answers: ar-Rahmân takes in the great gifts, at the root; ar-Rahîm follows for the fine and subtle ones.
Ibn Kathîr gives another reason: ar-Rahmân is His alone. No one else may be named by it, so it comes first.
Say: call upon Allah, or call upon ar-Rahmân. Whichever you call, His are the most beautiful names.
The Prophet ﷺ is described with the other word: to the believers, kind and merciful, rahîm.
An image passed among teachers: ar-Rahmân, a sea with crashing waves; ar-Rahîm, the same sea, calm.
Both at once: no mind can picture it. That is the point. His mercy is more than one image can hold.
You say it before every sûra and every meal: ar-Rahmân, ar-Rahîm.
Two words from one root, mercy. Why two? And why in this order?
Two shapes, one mercy: the word that overflows, and the word that reaches each one.
Tonight, in the Fâtiha, slow down on ar-Rahmân ar-Rahîm: hear two words, not one. Then ask Him by both.