Certainly was Allāh pleased with the believers when they pledged allegiance to you, [O Muḥammad], under the tree, and He knew what was in their hearts, so He sent down tranquility upon them and rewarded them with an imminent conquest1
Translation: Saheeh International (English)
1 That of Khaybar, which preceded the conquest of Makkah.
يُبَايِعُونَكَthey pledged allegiance to youyubāyiʿūnaka
تَحۡتَundertaḥta
ٱلشَّجَرَةِthe treel-shajarati
فَعَلِمَand He knewfaʿalima
مَاwhatmā
فِي(was) infī
قُلُوبِهِمۡtheir heartsqulūbihim
فَأَنزَلَso He sent downfa-anzala
ٱلسَّكِينَةَthe tranquilityl-sakīnata
عَلَيۡهِمۡupon themʿalayhim
وَأَثَٰبَهُمۡand rewarded themwa-athābahum
فَتۡحٗا(with) a victoryfatḥan
قَرِيبٗاnearqarīban
Tafsir
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.