What does @Published do?
The essence
@Published is a property wrapper that adds a Publisher to a class property: $property has type Published<Value>.Publisher with Failure == Never. It emits the new value on willSet — before the property has actually changed. It works in any class (not in a struct: the wrapper holds its inner publisher by reference), not only in an ObservableObject. ObservableObject merely adds the synthesized objectWillChange on top: the compiler forwards events from all @Published properties into it, and SwiftUI re-renders views on that.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep