Firefox might appear that way but it's not. The line uiSettingsAsInspectable.As(&uiSettings5) Is asking for the IUISettings5 interface from the IUISettings object.
These interfaces don't have a base as such, IUISettings2 doesn't inherit from IUISettings for example.
From the file windows.ui.viewmanagement.idl
under "runtimeclass UISettings" The interfaces listed here state that it supports the following interfaces. So, UISettings is the base (default) but supports UISettings2/3/4/5/6 interfaces as as well.