Opening and closing of stomata occurs due to the changes in the turgor pressure of the guard cells. When guard cells are turgid, stomatal pores are open, while in flaccid form, the stomatal pores are closed.
Stomata are the tiny pores present on the surface of the leaves. When large amount of gaseous exchange takes place in leaves through these pores, exchange of gases also takes place on the surface of stem roots and leaves. A large amount of water is lost through these pores. The plant closes these pores when carbon dioxide is not required for photosynthesis. So, guard cells comes into act.
Guard cells performs the opening and closing of these pores. The guard cells swell when water flows into these pores and stomatal pores get open, and as the water shrinks the guard cell closes.