While these events (or more precisely: their handlers) are briefly mentioned in the "Creating Nodes" section of the Node-RED docs, I cannot find more detailed information about them, in particular
when are these events emitted?
Could anybody please provide me with that information?
Those events are fired when the node is loaded into the palette (or removed).
If a node included other customisations, such as a custom sidebar or other UI elements, the onpaletteadd function is where they should get added. And onpaletteremove would be used to remove those customisations.
This sounds as if the event would be fired once when (after? before?) the editor is opened and once before the editor is closed (before reload? when tab is closed?)
I did not know that new node types may appear while the editor is open...
That's what happens when you use the Editor's manage palette menu. Npm packages containing node definitions are loaded in the background and entries for each defined note type are added via an API to the palette if they can be.