The answers you are looking for are linked from the documentation you provided a link to, here:
https://developer.apple.com/documentation/swiftui/migrating-from-the-observable-object-protocol-to-the-observable-macro?language=objc
The Observable macro is new and most of the Internet hasn't caught up yet. If you can use Observable, you can use @State instead of @StateObject, even for classes and structs.
The library lives outside the App struct. Lexically, it appears to be inside the struct, but SwiftUI manages its lifetime because of that @State macro. You can put a breakpoint inside Library's init to see when it called.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: