XPCOM has a set of core components and classes for file and memory management, threads, data structures, etc. Thanks to the component object model, all Gecko functionality is available as a series of components or cross-platform libraries, allowing you to access them with the web browser or any Mozilla application.
This is useful for developers since it allows them to write components in one of the supported languages. Those components are compiled and they can be used on multiple different platforms. Although XPCOM was mostly used by Firefox, the feature was removed in Firefox 57 and replaced with WebExtensions API.