The Star - 53:48 It is He Who makes rich and makes poor.
Why does Allah make rich or poor?
The Dawn/89:15 "When his Lord gives to man abundantly to test him, he says: "My Lord has been generous to me"."
فَاَمَّا الْاِنْسَانُ اِذَا مَا ابْتَلٰيهُ رَبُّهُ فَاَكْرَمَهُ وَنَعَّمَهُ فَيَقُولُ رَبّ۪ٓي اَكْرَمَنِۜ
The Dawn/89:16 "But when his Lord tests him by withholding his sustenance, he says, "My Lord has humiliated me."
وَاَمَّٓا اِذَا مَا ابْتَلٰيهُ فَقَدَرَ عَلَيْهِ رِزْقَهُ فَيَقُولُ رَبّ۪ٓي اَهَانَنِۚ

The Arabic Letter Sad/38:34 Thus did We test Solomon, and We added material wealth to his kingdom, but he turned wholly (to God).
وَلَقَدْ فَتَنَّا سُلَيْمٰنَ وَاَلْقَيْنَا عَلٰى كُرْسِيِّه۪ جَسَداً ثُمَّ اَنَابَ