Desktop environments usually consist of windows, toolbars, icons, menus, wallpapers and widgets at a basic level, but may also include items such as a file manager, collections of graphical themes, and sundry other applications.
I guess you're familiar with the major desktop environments: K Desktop Environment (KDE), and GNOME, Xfce, LXDE, LXQT.
Toolkits are used to create the widgets which proliferate in desktop environments, e.g. Qt and GTK+. Early ones were Motif, Tk, FLTK.
Fortunately, with open source software, the source code for all of the items typically included in a desktop environment is freely available. Any interested individual can inspect the code and get a very precise idea of how it's all constructed and put together. Free and open source code can be used by anyone in accordance with the free and open source licences like the GPL, MIT or Apache licences. The repositories of code are often in github or gitlab, or easy to search for online.
Here's a sample of some of what GNOME provides in its desktop environment:
Code:
gnome gnome-dictionary gnome-paint gnome-shell-extension-prefs
gnome-2048 gnome-disk-utility gnome-panel gnome-shell-extension-runcat
gnome-accessibility-themes gnome-dust-icon-theme gnome-panel-control gnome-shell-extensions
gnome-activity-journal gnome-dvb-client gnome-panel-data gnome-shell-extensions-extra
gnome-api-docs gnome-dvb-daemon gnome-pass-search-provider gnome-shell-extension-shortcuts
gnome-applets gnome-epub-thumbnailer gnome-passwordsafe gnome-shell-extension-system-monitor
gnome-applets-data gnome-extra-icons gnome-pie gnome-shell-extension-tiling-assistant
gnome-audio gnome-feeds gnome-pkg-tools gnome-shell-extension-vertical-overview
gnome-autoar gnome-firmware gnome-platform-devel gnome-shell-extension-weather
gnome-backgrounds gnome-flashback gnome-power-manager gnome-shell-mailnag
gnome-bluetooth gnome-flashback-common gnome-remote-desktop gnome-shell-pomodoro
gnome-bluetooth3 gnome-font-viewer gnome-robots gnome-shell-pomodoro-data
gnome-bluetooth-3-common gnome-games gnome-screensaver gnome-software
gnome-bluetooth-common gnome-genius gnome-screensaver-flags gnome-software-common
gnome-bluetooth-sendto gnome-gmail gnome-screenshot gnome-software-dev
gnome-boxes gnome-human-icon-theme gnome-session gnome-software-doc
gnome-brave-icon-theme gnome-hwp-support gnome-session-bin gnome-software-plugin-flatpak
gnome-breakout gnome-icon-theme gnome-session-canberra gnome-software-plugin-snap
gnome-browser-connector gnome-icon-theme-gartoon gnome-session-common gnome-sound-recorder
gnome-builder gnome-icon-theme-nuovo gnome-session-flashback gnome-split
gnome-calculator gnome-icon-theme-suede gnome-settings-daemon gnome-subtitles
gnome-calendar gnome-icon-theme-yasis gnome-settings-daemon-common gnome-sudoku
gnome-calls gnome-illustrious-icon-theme gnome-settings-daemon-dev gnome-sushi
gnome-calls-doc gnome-initial-setup gnome-shell gnome-system-monitor
gnome-cards-data gnome-keyring gnome-shell-common gnome-system-tools
gnome-characters gnome-keyring-pkcs11 gnome-shell-extension-appindicator gnome-taquin
gnome-chemistry-utils gnome-keysign gnome-shell-extension-arc-menu gnome-terminal
gnome-chess gnomekiss gnome-shell-extension-autohidetopbar gnome-terminal-data
gnome-clocks gnome-klotski gnome-shell-extension-bluetooth-quick-connect gnome-tetravex
gnome-color-manager gnome-logs gnome-shell-extension-caffeine gnome-text-editor
gnome-colors gnome-mahjongg gnome-shell-extension-dashtodock gnome-theme-gilouche
gnome-colors-common gnome-maps gnome-shell-extension-dash-to-panel gnome-themes-extra
gnome-commander gnome-mastermind gnome-shell-extension-desktop-icons-ng gnome-themes-extra-data
gnome-commander-data gnome-menus gnome-shell-extension-easyscreencast gnome-themes-standard
gnome-common gnome-mime-data gnome-shell-extension-espresso gnome-todo
gnome-connections gnome-mines gnome-shell-extension-flypie gnome-tweaks
gnome-console gnome-mousetrap gnome-shell-extension-freon gnome-usage
gnome-contacts gnome-mpv gnome-shell-extension-gamemode gnome-user-docs
gnome-control-center gnome-multi-writer gnome-shell-extension-gpaste gnome-user-share
gnome-control-center-data gnome-music gnome-shell-extension-gsconnect gnome-video-arcade
gnome-control-center-dev gnome-nds-thumbnailer gnome-shell-extension-gsconnect-browsers gnome-video-effects
gnome-core gnome-nettool gnome-shell-extension-hamster gnome-video-effects-dev
gnome-desktop gnome-network-displays gnome-shell-extension-hard-disk-led gnome-video-effects-frei0r
gnome-desktop3-data gnome-nibbles gnome-shell-extension-hide-activities gnome-weather
gnome-desktop-3-tests gnome-noble-icon-theme gnome-shell-extension-impatience gnome-wine-icon-theme
gnome-desktop-testing gnome-online-accounts gnome-shell-extension-kimpanel gnome-wise-icon-theme
gnome-devel gnome-packagekit gnome-shell-extension-manager
gnome-devel-docs gnome-packagekit-common gnome-shell-extension-no-annoyance
gnomediaicons gnome-package-updater gnome-shell-extension-panel-osd