The foundational midrashic statement appears in Vayikra Rabbah 29:3, where Rabbi Yehudah beRabbi Nachman teaches from Tehillim 47:6 that when the Holy One ascends to sit in judgment He rises to the כסא דין, but when Israel takes their shofars and sounds them before Him, He arises from the כסא הדין and sits upon the כסא של רחמים — filling with mercy and transforming the attribute of judgment into mercy — and this occurs in the seventh month.
The same tradition is recorded in Pesikta DeRav Kahana 23:3, attributed there to Yehudah bar Nachman in the name of Reish Lakish, and again in Pesikta Rabbati 40, which adds David's declaration that nothing is as great as the shofar, which displaces the attribute of judgment and draws near the attribute of mercy, citing the same pasukim of Tehillim 47.
A parallel version of the image appears in Vayikra Rabbah 29:6, where the Holy One Himself tells Israel: just as the shofar takes in on one side and releases on the other, so too He arises from the כסא הדין and sits upon the כסא רחמים, transforming the attribute of judgment into the attribute of mercy — again specifically in the seventh month.
The Gemara in Avodah Zarah 3b presents a related daily dimension: Rav, as cited by Rav Yehudah, teaches that during the second three-hour segment of the day God sits and judges the entire world, and when He sees that the world has rendered itself liable to destruction, He arises from the כסא הדין and sits upon the כסא רחמים, so that the world is not destroyed.
The Zoharic tradition carries the imagery further: מכתב מאליהו, חלק ה עמוד רמא cites the Zohar — as brought in the Taamei HaMitzvot of the Radbaz — that the sound of the shofar rises and strikes forcefully against the כסא הדין and ascends above to the כסא רחמים, with that striking described as a kind of battle, since teshuvah belongs only to unceasing struggle, and it is through this that one ascends from a state of din to a state of mercy.
The Zoharic literature also frames the two thrones in terms of the calendar: זהר, זהר חדש בראשית יתרו קמו associates the prayer of Rosh HaShanah with the כסא הדין, where God sits as judge with all the heavenly hosts arrayed to His right and left, in contrast to the prayer of Pesach, which corresponds to the כסא רחמים.
The Sefat Emet draws out the inner meaning of this transition in two places: Sefat Emet, Devarim, Rosh HaShanah 8:4 explains that through Israel's understanding that being remembered before God is itself a great gift — even as it is unto judgment — they sweeten the decrees and thereby cause the Holy One to turn from the כסא דין to the כסא רחמים; and Sefat Emet, Devarim, Rosh HaShanah 10:3 connects this to the primordial pattern of creation, noting that just as the world was first conceived in strict judgment and then sustained by joining it with mercy, so too every Rosh HaShanah begins in din and is transformed through the shofar-blasts from כסא דין to כסא רחמים.
Tzitz Eliezer (21:15) discusses the teaching that when Israel sounds the shofar, the Holy One stands from the throne of judgment and sits upon the throne of mercy.
Tzitz Eliezer (21:16) similarly addresses the image of God rising from the seat of judgment and sitting on the seat of mercy, and holds that God transforms judgment into mercy for the people.