This is some kind of optimization that I came to appreciate. By doing it like this, duplicated values are $lookup-ed up only once save processing time on the server. It also preserve bandwith since duplicate resulting documents are not sent over the wire.
An alternative to the $unwind/$group would be $set stage where you use $map to complete the source array with the resulting array. That would negate the optimization supplied by default. But that’s fine because it would be your choice and others, like me would keep benefiting from the optimization. I prefer to do this kind of data structure cosmetic at the application level as it is easier to scale. Doing the final matching and sending duplicate data from the server affects all users. Doing the final matching in the client code, and even in the front end, only affect the ones with duplicate.