Sweating has different meanings in the kitchen. It can refer to the slow cooking of vegetables over low heat in their own juice. Onions and shallots are sweated particularly often. They give off their own juice and become glassy and soft without intense aromas being released through roasting. Constant stirring while sweating prevents the vegetables from burning. As soon as enough juice has escaped, you can finish steaming the onions with the lid closed.
In addition, stirring a roux is referred to as sweating. This cooking technique creates a creamy base for thickening sauces after adding flour to heated fat such as butter.