In order that you not despair over what has eluded you and not exult ˹in pride˺ over what He has given you. And Allah does not like everyone self-deluded and boastful -
لِكَيْلَا تَأْسَوْا عَلَىٰ مَا فَاتَكُمْ وَلَا تَفْرَحُوا بِمَا آتَاكُمْ ۗ وَاللَّهُ لَا يُحِبُّ كُلَّ مُخْتَالٍ فَخُورٍ