Answer:
In any living mammalian body there are mechanisms in place that regulate the blood volume.
When a mammal drinks the water enters the blood and has the effect of increasing the volume of blood in the body.
The body detects the increase in blood volume/pressure and releases hormones which switch on the kidneys.
The kidneys begin to remove water (along with dissolved metabolic waste which is also in the blood) until the blood volume returns to normal.
Thus the volume of urine produced is in proportion with the volume of fluid consumed (allowing for loss as a result of sweat and respiration).
There are cases where this mechanism fails. One of these is if a person in immersed in water for a time. A vertical swimmer experiences a higher pressure in the lower limbs than in the upper body causing blood that naturally pools in the legs to be forced into the upper body. When this happens the body mechanisms see this as an increasing blood volume and the kidneys are turned on (which is why you want to pee when you swim).
If a person who has been in water for some time (peeing) is then suddenly pulled out of the water in a vertical position. The blood re-pools in the legs and is therefore extracted form the upper body causing a sudden drop in blood pressure (clinical shock). which can prove fatal.
Thus the amount you drink largely determines the amount of urine produced.