Surah Al-Fath

48:18

۞ لَّقَدْ رَضِىَ ٱللَّهُ عَنِ ٱلْمُؤْمِنِينَ إِذْ يُبَايِعُونَكَ تَحْتَ ٱلشَّجَرَةِ فَعَلِمَ مَا فِى قُلُوبِهِمْ فَأَنزَلَ ٱلسَّكِينَةَ عَلَيْهِمْ وَأَثَٰبَهُمْ فَتْحًۭا قَرِيبًۭا

Certainly was Allah pleased with the believers when they pledged allegiance to you, [O Muhammad], under the tree, and He knew what was in their hearts, so He sent down tranquillity upon them and rewarded them with an imminent conquest

Tafsir 48:18

Verily, Allah was pleased with the believers when they were giving their oaths to you at Ḥudaybīyyah i.e. Bay‘at Al-Riḍwān under the tree. Allah knew of the faith, sincerity and honesty in their hearts and sent down tranquility on their hearts. And He rewarded them for it with a victory in the near future i.e. the victory over Khaybar, as consolation for them missing out on being able to enter Makkah.