If you are provided with some vegetables to cook, you generally add salt into the vegetables

If you are provided with some vegetables to cook, you generally add salt into the vegetables. After adding salt, vegetables release water. Why?

Answer:
When salt is added, a hypotonic medium is created, i.e., the concentration of salt molecules is more outside the vegetables than inside. Hence, due to osmosis water from the vegetables come out.