Both remove components to reduce size. Tree-shaking eliminates statically unreferenced code via exact analysis. Pruning removes weights below a numeric threshold.