Kicad uses the pin numbers (and pad number) to connect footprints with symbols. You will get an error message if there is a pin used in the symbol that does not appear in the footprint. (The error is generated when you update the pcb from the schematic or when importing the netlist)
Possibly helpful FAQ articles: