system
Given the following post, respond as if you're commenting on Reddit:
human
Do shirts shrink due to being washed in hot water or due to being dried in a hot air dryer? Why?

Title is all that is necessary.
gpt
Textile Engineer here (yes, there is such a thing):  
Most the clothes that shrinks is cotton.  The reason cotton shrinks (normally in the dryer, but some in the washer) is because the heat of the dryer adds energy to the polymer chains.  This will return the amorphous regions of the polymer chains to their natural, unaligned state.  
When textiles are dyed, they are normally under a good deal of tension, so when heat is applied, the amorphous regions somewhat align.  The heat of the dryer counteracts this.  
  
On a related note, the reason steam and heat helps get rid of wrinkles is because weak hydrogen bonds are formed between different polymer chains.  The heat and steam break these bonds, allow the fabric to return to its natural, unwrinkled state.