529 Defunding as Child attends school

Why would the earnings portion be taxable ? Is there a differentiation between a need based grant and merit aid ?

I’ll have to read deeper…the govt has over complicated this.