The work presented in this thesis focuses on a specific group of evolved stars, the S stars, which have stellar atmospheres with a peculiar chemical composition. Most of these stars exhibit a cool dusty stellar wind. The dust particles in this stellar outflow are built from the same atoms and molecules that are present in the stellar atmosphere. In this thesis, we aim to gain insight in the relation between the chemical composition and dynamics of the stellar atmosphere on the one hand, and the chemical and physical properties of the circumstellar gas and dust on the other hand. The work we present is embedded in the research of stars evolving along the Asymptotic Giant Branch (AGB). During this evolutionary phase, the star undergoes drastic changes in chemical composition of the stellar atmosphere. This change in chemical content is very complex and plays a major role in our understanding of the origin and distribution of elements. We focus in this thesis on the subgroup of S stars. For these stars, this change in chemical composition of the stellar atmosphere is reflected in the appearance of the circumstellar environment. Another important characteristic of AGB stars is the mass loss. It is generally accepted that the mass loss of AGB stars is dust-driven: pulsations bring the envelope far from the stellar equilibrium radius, where the temperatures are low enough for dust-condensation. This dust is accelerated by radiative pressure and drags the gas along with it. The theory behind this mass-loss process is not yet fully understood. The mass loss depends not only on the dynamics of the stellar atmosphere, but also on the physical and chemical properties of the dust grains. A small step towards understanding this mechanism is making an inventory of all dust species that can be observed around AGB stars and by analysing how the formation of these species can be tied back to the properties of the stellar atmosphere. In this thesis, we make these small steps for a large sample of S stars, based on a unique dataset of high-quality infrared spectra obtained with the Infrared Spectrograph onboard the Spitzer satellite.