we gave wisdom to luqman so that he would give thanks to god. those who give thanks to god do so for their own good. those who are ungrateful should know that god is selfsufficient and praiseworthy.
ولقد آتينا لقمان الحكمة أن اشكر لله ومن يشكر فإنما يشكر لنفسه ومن كفر فإن الله غني حميد