We combine experiments and numerical computations to examine underlying fluid mechanical processes associated with bioaerosol generation during violent respiratory maneuvers, such as coughing or sneezing. Analogous experiments performed in a cough machine - consisting of a strong shearing airflow over a thin liquid film - allow us to illustrate the changes in film topology as it disintegrates into small droplets. We identify that aerosol generation during the shearing of the liquid film is mediated by the formation of inflated baglike structures. The breakup of these bags is triggered by the appearance of retracting holes that puncture the bag surface. Consequently, the cascade from inflated bags to droplets is primarily controlled by the dynamics and stability of liquid rims bounding these retracting holes. We also reveal the key role of fluid viscosity in the overall fragmentation process. It is shown that more viscous films when sheared produce smaller droplets.