We show theoretically and empirically that flows into index funds raise the prices of large stocks in the index disproportionately more than the prices of small stocks. Conversely, flows predict a high future return of the small-minus-large index portfolio. This finding runs counter to the CAPM, and arises when noise traders distort prices, biasing index weights. When funds tracking value-weighted indices experience inflows, they buy mainly stocks in high noise-trader demand, exacerbating the distortion. During our sample period 2000-2019, a small-minus-large portfolio of S&P500 stocks earns ten percent per year, while no size effect exists for non-index stocks.