Commentary
The word: ثَمَرٌ (thamar) in: وَكَانَ لَهُ ثَمَرٌ (And he had wealth - 34) means the fruit of trees as well as wealth, in an absolute sense. At this place, Sayyidna Ibn ` Abbas ؓ ، Mujahid and Qatadah have taken it in the later sense (Ibn Kathir) According to the Lexicon, al-Qamus, this word is used to denote the fruit of the tree and wealth of all kinds. This tells us that not only did he own gardens and farms, he also had gold, silver and other luxuries. Even his words reported by the Qur'an: (I am greater than you in wealth -34) also express the same sense. (Ibn Kathir)
About the statement: مَا شآء اللہ لا قُوَۃَ اِلَّا بِاللہِ : "[ Everything is ] as Allah wills. There is no power except with Allah," it has been reported in Shu'ab al-'Iman on the authority of Sayyidna Anas ؓ that the Holy Prophet ﷺ said, "whoever sees something, likes it - and says 'masha'Allahu la quwwata illa bil-lah' - nothing will harm it (that is, what he likes will stay protected).' And it appears in other reports, 'whoever recites this kalimah when he likes something he sees, it will stay protected against the evil eye.'
The gist of the arguments of these two persons, as explained by Maulana Ashraf Ali Thanavi (رح) in Khulasa-e-Tafsir
These verses have described the event of two persons one of whom had a lot of wealth and, proud of it, he refused to accept that there is any life after death, and if there is one, he claimed, he will be given more wealth and reward therein. His argument was that if Allah was not pleased with him, he would not have this amount of wealth in this world.
The other person, though less than him in wealth, was a true believer. He refuted the argument of the former one by saying that the worldly wealth is not a sign of one's being close to Allah, because the worldly benefits are given by Allah, in one way or the other, even to the disbelievers and sinful persons, rather to the snakes, scorpions and beasts. It is a horrible mistake to presume that they are the signs of one's being approved by Allah. Therefore, neither your wealth is the proof of your behaviour being approved by Allah, nor my lesser wealth is a proof of disapproval by Him. Allah's approval or disapproval depends on one's faith and deeds alone and not on the amount of wealth one has.