Why do we bow down, prostrate, and say things like “Kadhalikullahu Rabi” after Surat Al-Ikhlas? Imam Al-Sadiq (as) explains the first prayer of the Prophet (sawa) in the Heavens in the presence of His Lord.

‘I (the narrator) said to Abu Abdullah (as): ‘The companions of the time are saying, ‘How did the Prayer come to be one rak’ah (bowing down) and two Prostrations, and did not become one rak’ah and one Prostration?’ So the Imam (as) said: ‘When you ask something, so free your heart in order to understand. The people are alleging that the first Prayer which Rasool-Allah (sawa) Prayed was on the earth. Jibraeel came to him with it, but they are lying.
The first Prayer, Rasool-Allah (sawa) Prayed was in the sky in front of Allah Blessed and High, facing His Throne, Majestic is His Majesty. Allah Revealed unto him, and Commanded him that hes should approach [38:1] Saad. So he performed ablution. And He Said: “Perfect your ablution (Wudhu), and clean your prostration places (Masjids), and Pray to your Lord”.
I (the narrator) said to him (as), ‘And what is the ‘Saad’?’ He (as) said: ‘A spring beneath a corner from the corners of the Throne, Prepared for Muhammad (sawa)’. Then Abu Abdullah (as) recited [38:1] Saad. I Swear by the Quran, full of Remembrance. So he performed his ablution from it, and perfected his ablution, and faced the Throne of the Beneficent. So he stood upright, and Allah Revealed unto him with the Opening of the Prayer (Takbiratul Ihram [?]), so he did that. Then, Allah Revealed unto him, with the Opening of the Book (Surah Al-Fatiha) and Commanded him that he should read it.
Then Allah Revealed unto him: “Read, O Muhammad (sawa)! The Lineage your Lord”. So Rasool-Allahsaww recited: [112:1] Say: He, Allah, is One. [112:2] Allah is the One on Whom all depend. Then the Blessed and High Held back the Speech from him. So, Rasool-Allah recited from his own self: Allah is One, Allah is ‘Al-Samad’, the Alone, the One, the ‘Samad’.
Then, Allah Blessed and High Revealed unto him: “Read – [112:3] He begets not, nor is He begotten. [112:4] And none is like Him. So he recited it, and Allah Held back the Speech from him. So, Rasool-Allah (sawa) recited from his own self: ‘Such is Allah, our Lord’. (“Kadhalikullahu Rabi” – this is often said after Surat Al-Ikhlas as a mustahhab/recommended sunnah)
So when Rasool-Allah (sawa) said that, Allah Revealed unto him: “Stand straight for your Lord, O Muhammad (sawa), and make a sacrifice”. So he stood up and established himself in front of Allah (and bowed down his head as a symbol of sacrifice). So Allah Revealed unto him: “Prostrate to your Lord”. So he fell down in prostration. And Allah Revealed unto him: “Sit upright, O Muhammad (sawa)’. So he did it. So when he raised his head from the first Prostration, his Lord Blessed and High Unveiled (His Light) unto him, so he fell down in prostration from his own self, not by the Command of his Lord. So that flowed as a Grace from Allah, and as a Sunnah from Allah and from Rasool-Allah’ (and became part of the Salah).

Sanad: Al-Baqry, from his Father, from Fadhaalah, Al Husayn Bin Abu Al A’ala

Source: Al-Mahaasin, Volume 2, Book 1, Hadith 64 (See Image)