When you press Run, Xcode builds the selected target, installs the result on the chosen destination, launches its process, and attaches the debugger. iOS creates the application environment and invokes the entry point marked with @main.
In a SwiftUI app, the App value describes one or more scenes. A WindowGroup scene creates a window and its root view. SwiftUI evaluates the view hierarchy from current state and updates the rendered interface when that state changes.
The app process and its interface do not remain in one condition. A scene can become active, temporarily inactive, or move to the background. The system may later terminate a background app, so important user data should be saved when it changes or when a relevant transition occurs.