One example of when you would want to use type erasure for a publisher (AnyPublisher) is when you want to use a pair of public and private properties, to allow the owner of those properties to send values on the private publisher, and let outside callers only access the public publisher for subscribing but not be able to send values.
๐ Combine - Asynchronous Programming with Swift (p.62)