Tmp files

In the forum at several instances the recommandation is given: “Delete the tmp files” .

What is the function of the Piwik tmp folder (…/piwik/tmp/) and what is the fuction of the cache folder (…/piwik/tmp/cache).

When are the files in these folders created ?
When are the files in these folders needed?
Under which circumstances these files can be deleted?
What information is lost after deleteing these files?

Many thanks in advance for answering.
J.P.Peters Netherlands

Not an answer but it made me create this feature request : Add CLI command core:clear-tmp · Issue #6402 · matomo-org/matomo · GitHub