Documentation of /system/addon.d Placing scripts into /system/addon.d/ makes them execute before and after every OTA packag upgrade.
This
is
used
or
mentioned
in
multiple
places.
I have multiple questions about this:

Is this a general Android feature or just provided by many custom ROMs? If only ROMs, any notable exceptions?
Where is the documentation / specification / source ? I would like to get to the APIs that I can work with.
(related) What is it with this /tmp/backuptool.functions that seemingly anyone is sourcing at the beginning of the script. How could I find out which functions are provided by this and what they do?

Thanks a lot!
It's not a standard, but just a convention which is followed by many in custom ROM world. IIRC it's the LineageOS/CM who introduced the idea. So their repo is the best place to see latest changes.
There is no complicated API, just a few bash script functions to backup/restore some files during OTAs (dirty flashes).