Some colours in the palette may not actually be used in the design. This can happen if all the stitches for a colour have been removed or colours have been added to the palette and then not used.
The removed unused command will delete any unused colours from the palette thus making it easier to see the colours in the design.
Note that unused colours will not appear in the key even if they are not removed from the design but they can make it more difficult to find colours in the design palette.