This occurs because of their fertilization. They grow there because they need water to carry cells to fertilize them so they can reproduce. They are not fertilized by wind or by bees like other plants, so they need to be in areas where there's a lot of water. This is just how they adapted to there environments.