Trading volume is usually higher when the price of a security is changing because changes in price happen due to a catalyst that affects perception of the security. This leads to altered supply and demand dynamics. When supply and demand changes for a security, it leads to transactions until a new price equilibrium is discovered. These transactions drive trading volume higher.
Price discovery is the purpose of markets. Changes in price only happen when supply or demand overwhelm one another. Supply and demand only change when some catalyst hits the market. The price changes until supply and demand find a new equilibrium with the catalyst taken into account.
Some potential catalysts include economic news, earnings announcements, news releases, management changes, strategy changes or price breaking some important technical level. Typically, this comes as a surprise to the market, leading to a period of pricing in the news.
An example would be a company reporting positive earnings above the market's expectations. This leads to a surge in demand; buyers believe the shares are undervalued since the company is outperforming. The price rises until demand decreases and supply increases to match it. Volumes would be elevated as a number of sellers are taken out as the price rises.
Many short-term, technical trading strategies rely on price and volume as key inputs to gauge supply and demand dynamics in the market. One cornerstone of thinking behind this strategy is to look for big moves in a security backed by volume as a strong demand indicator. Big moves not backed by volume are more likely to be reversed.