How? I assume it's mostly using proprietary MacOS APIs, and, ignoring that it doesn't really matter beyond apple being an abusive partner, lawyers are a powerful tool (This software is under the Apple don't take the piss licence)
Assuming the License is that restrictive, only those who are financially invested in Preview working well (and only on macOS) will have any incentive to contribute code.
I can't think of any company other than Apple that fit this description.