Structured concurrency & scopes
Every coroutine has a parent
Module 3 taught you viewModelScope.launch { ... } as a fire-and-forget way to start a coroutine. It isn't really fire-and-forget β every coroutine you launch becomes a child of the scope that started it, and viewModelScope is itself backed by a Job that lives exactly as long as the ViewModel does. When the ViewModel is cleared, its Job is cancelled, and every coroutine hanging off it β direct child or grandchild β is cancelled too. That's structured concurrency: no coroutine can outlive the scope that owns it.
That parent-child relationship is a real tree, and it matters most when something goes wrong. Launch two children under the same parent Job and let one of them throw β by default, the exception propagates up to the parent, the parent cancels, and every sibling gets cancelled with it. One bad walker photo download shouldn't be able to kill an unrelated booking refresh, so knowing when that blast radius is too wide is the whole point of this lesson.