This is an excellent summary showing the utility of a periodic erase / install on iOS to let the system reclaim all the space in the filesystem.
One a technical level, SSD storage is made up of multiple cells and there are more complicated storage overhead than a traditional hard drive. This allows for the capacity to not decrease to the user when bad cells are mapped out of service as well as to allow wear leveling. Over time, eventually every storage device will have more and more blocks fail and you would see the same drop off on usable storage. Also, each iOS version uses different amounts of space:
I don't think the combination of OS overhead and bad blocks is the main cause for you, though. Based on your "unaccounted" size, it's likely orphaned files that no longer "belong" to any app.
To test this, make a backup of your iOS data to iCloud and/or to a computer and then restore the device.
Do not add any apps or settings back on the device and repeat the storage measurement. Then you will know if the true capacity was as originally delivered from the factory. If so, all your loss and overhead was filesystem fragmentation, lost files that weren't marked as "belonging" to a specific app.
If you wipe and still have all that space "lost" then it might be technically accurate and a sign the storage doesn't give you the designed capacity and a "repair" would fix it by swapping the device for one with the correct amount of available storage.