The brewing process releases chemicals call lactones that are slightly bitter. As coffee cools, lactones break down into smaller carboxylic acids, which are unpleasantly bitter. When coffee is reheated, these carboxylic acids remain along with the bitter taste.
However, when fresh coffee is poured quickly over ice, carboxylic acids have less time to form so your coffee tastes better.
The best is cold press coffee as carboxylic acids don't form at all.