Plants need water to grow.
When the water is abundant they grow more leaves and forget to produce fruits.
When the water is scarce they feel that they are going to die soon, they produce fruits to continue their generation.
Just water your plants enough to keep their normal life!