You can see how both are used in the chain posted
here. If you want to save a file using the plugin based on a template like {authors}\{title}, there are chances they contain illegal characters not supported by OS for filenames. sanitize_path() removes these illegal characters.