Surfactant is a complex mixture of lipids and proteins produced by type II alveolar cells in the lungs. It plays a critical role in the respiratory system by reducing surface tension within the alveoli, facilitating gas exchange, and preventing alveolar collapse during exhalation.