Hypoxia occurs when an overabundance of nutrients ( such as nitrogen and phosphorous ) trigger excessive algae growth that results in reduced sunlight , loss of aquatic habitat and a decrease in oxygen in the water .