How is reproducing sexually and asexualy in plants an adaptation?

thanks