Basically describes switching threads back and forth using DispatchQueues... pretty much as it was done with UIKit back on iOS 8. Nothing here was really dependent upon or related to SwiftUI.
The first async block is needed since you're doing your own background processing, but normally wouldn't be required if you were making an API call using URLSession. (Which switches for you.) Only the return to main thread be be needed.
I'd suggest exploring async/await, triggering functionality from a SwiftUI task modifier, and using MainActor to perform UI updates.