Why is Xcode 12.2 as large as macOS Big Sur? Just as the title says...

Xcode 12.2 is a 11.4 GB
MacOS Big Sur is a 12.18 GB

Xcode is just an application while Big Sur is a complete Operating System. How come a macOS application is as large as the OS itself?
Is Xcode bringing in components that are not part of the standard OS?
Xcode 12.2 unpacked is 16.8 GB, 13.2 GB of which are platform operating systems.

iPhoneOS.platform is 5.9 GB
AppleTVOS.platform is 3.6 GB
WatchOS.platform is 3.3 GB

In comparison, MacOSX.platform is only ~300 MB since most of the platform is already available in a normal installation of macOS. Xcode doesn't just build apps for macOS — it also builds apps for other operating systems and runs a simulator of each OS.