How a brokerage account is taxed

Dividends and interest are taxed each year, and gains are taxed when realized.