Think about a PC or a Mac
A window consists of a frame area and body area that lets the user view and interact with content in an app. A window can appear onscreen alongside other windows, or it can fill the entire screen.
https://developer.apple.com/design/human-interface-guidelines/macos/windows-and-views/window-anatomy/
https://developer.apple.com/documentation/swiftui/windowgroup
Imagine 2 Safari windows or 2 Xcode windows.
A Window contains Views such as buttons, menus, lists, images, etc.
UIApplication.shared.windows[0].rootViewController.view
Is UIKit based code not SwiftUI, you won't find any documentation on it with the SwiftUI Framework documentation but there are plenty of "old" references that break down what it is.
https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/TheViewControllerHierarchy.html