Dawud and Sulayman and the Signs which They were given; the Story of the People whose Sheep pastured at Night in the Field
Abu Ishaq narrated from Murrah from Ibn Mas`ud: "That crop was grapes, bunches of which were dangling." This was also the view of Shurayh. Ibn `Abbas said: "Nafash means grazing." Shurayh, Az-Zuhri and Qatadah said: "Nafash only happens at night." Qatadah added, "and Al-Haml is grazing during the day."
(And (remember) Dawud and Sulayman, when they gave judgement in the case of the field in which the sheep of certain people had pastured at night;) Ibn Jarir recorded that Ibn Mas`ud said: "Grapes which had grown and their bunches were spoiled by the sheep. Dawud (David) ruled that the owner of the grapes should keep the sheep. Sulayman (Solomon) said, `Not like this, O Prophet of Allah!' Dawud said, `How then' Sulayman said: `Give the grapes to the owner of the sheep and let him tend them until they grow back as they were, and give the sheep to the owner of the grapes and let him benefit from them until the grapes have grown back as they were. Then the grapes should be given back to their owner, and the sheep should be given back to their owner.' This is what Allah said:
Subservience of Jinns and shaitans to Sulayman (علیہ السلام)
وَمِنَ الشَّيَاطِينِ مَن يَغُوصُونَ لَهُ وَيَعْمَلُونَ عَمَلًا دُونَ ذَٰلِكَ ۖ وَكُنَّا لَهُمْ حَافِظِينَ (And from the devils, (We subjugated for him) those who dived in water for him and did jobs other than that. And We were the One who kept watch over them. - 21:82) That is, Allah made the satan jinn subservient to Sulayman (علیہ السلام) and they used to dive in the rivers fishing pearls for him. Apart from this, they used to perform other jobs for him, some of which are mentioned in other verses.
يَعْمَلُونَ لَهُ مَا يَشَاءُ مِن مَّحَارِيبَ وَتَمَاثِيلَ وَجِفَانٍ كَالْجَوَابِ That is ("Fashioning for him whatsoever he would - places of worship, statues, porringers like water-troughs - 34:13). Sulayman (علیہ السلام) also used to put them to hard labour and make them work in different projects.
Shaitans
These are ethereal beings made of fire, who possess intelligence and understanding and are obligated to follow the laws of Shari` ah like humans. Those beings who fulfill these conditions are described by the word Jinn, while those among them who disobey the rules of Shari'ah and persist in their unbelief are called satans. It is obvious that all Jinns were made subservient to Sayyidna Sulayman (علیہ السلام) whether they were believers or unbelievers. However, the believers regarded it as their religious duty to obey his wishes even before they were formally placed under his command, and there was no need to make a specific mention of their being placed under subservience to Sulayman (علیہ السلام) . Hence in the context of the Jinns being made subservient to Sayyidna Sulayman (علیہ السلام) the reference is to shaitans (unbelieving Jinns) only. They were made to obey him despite their unbelief and defiance. Perhaps, it is for this reason that a sentence is added at the end of the verse saying, "We alone kept watch over them". Sulayman (علیہ السلام) was exposed to danger from the unbelieving Jinns, but Allah was his protector and they could do him no harm.
It will be observed that while in the case of Sayyidna Dawad (علیہ السلام) Allah Ta` ala had made subservient to him things which are extremely hard and dense, like iron and mountains, Sulayman (علیہ السلام) was given mastery over things which are ethereal and cannot even be perceived e.g. wind and Jinn. This shows that He is omnipotent and that His authority extends over all created things. (Commentary by Ra'zi)
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 82–83
Here the taming of the winds means making navigation on the seas a possibility, for in ancient times ocean travel was revolutionised when man invented ships with sails. The sails were in fact a means of harnessing the winds and performed the function of engines for the ships of those days. The invention of ships with sales made the oceans not only navigable, but also suitable for transporting heavy cargo. This gives an indication that man was taught the science of navigation on the seas through the prophets. Besides this, a group of jinn was made subservient to the Prophet Solomon (Sulayman). They used to execute for him large welfare projects which could not be done by ordinary men. In the modern machine age, such enormous tasks of human welfare are performed by machines. Before the machine age, in order to facilitate the performance of major projects, God had made the jinn subordinate to His prophets.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.