I have heard that when a fish is kept in an aquarium that is too small for the fish to grow to its full size, it will only grow to a portion of its possible size and its lifespan will be shorter than it would normally be. If this is true, why does having a small tank cause stunted growth in fish?
Fish excrete hormones in their waste. In a confined space like an aquarium, these hormones build up and act as growth inhibitors, this is basically an evolutionary mechanism, to prevent fish from dying if they end up in a water system that is cutoff from continuous fresh water. The larger the fish, the more space and continuously replenished clean water they need for survival. Fish do not "grow to the size of their tank", as is often quoted, they are basically poisoned by their own waste which prohibits them from reaching their potential in a poorly sized or cared for environment.
Because they die before they reach full size. Either from being poisoned by their own waste, or from complications due to their organs growing while their bodies are stunted.
It's like saying that a puppy grows to the size of the shoebox it's kept in. Keep a puppy in a shoebox, and it isn't going to reach maturity.