What is the difference between collect and sum? | SAP ABAP

SUM.
When processing an internal table in a block starting with LOOP and concluded by ENDLOOP , SUM calculates the control totals of all fields of type I , F and P (see also ABAP/4 number types ) and places them in the LOOP output area (header line of the internal table or an explicitly specified work area).
COLLECT.
COLLECT is used to create unique or compressed datasets. The key fields are the default key fields of the internal table itab .