Since Transformations are lazily calculated and behave in a lifecycle aware manner they can be used within the ViewModel, in combination with domain-level LiveData publishers, for publishing UI updates.
So switchmap is designed for dealing with asynchronous events. Lets say you're querying a database - an asynchronous operation - and publishing the results via LiveData in the manner described above. Lets say your application makes 2 queries in quick succession - query 1 returning response 1 (used to update the UI), and query 2 returning response 2. And let's say that although you sent query 1 first, it completes and arrives after query 2. With the regular Transformations.map() operator response 1 will be published last, and will determine the final application state. With Transformations.switchMap() the moment you send query 2 the first response will be effectively unsubscribed to, and you will only receive the second response. The way this works is the LiveData returned by Transformations.switchMap() delegates to another, internal LiveData publisher within the switchMap implementation. This internal LiveData publisher is recreated / resubscribed to on every update. But note that this wouldn't guarantee synchronization with the database in this example. You'd still receive response number 1 from the database... you just wouldn't be listening to it.
This would only really be useful in cases where the request you’re sending is non-mutating, the UI is intended to drive the application state, and either your client or the service you're interacting with can't guarantee ordering of requests / responses. Assuming you're using TCP, responses arriving out of order is not even possible. Not only does TCP guarantee ordering of requests / responses, but the OS manages an internal connection pool and ensure that your client has just one TCP connection per origin; or if it does spawn multiple connections (sometimes a performance optimization) this will be transparent to the application layer. So this scenario isn't even possible without using some custom protocol / low level connection management. If you believe your architecture behaves this way you probably are either confused or there are deeper problems in your application. Perhaps the Android devs who added this method were confused too, it's hard for me to imagine a practical application for this method, but I digress...
The docs give an example of using switchMap, where the user is inputting an address and a service is returning a zipcode. The user input is what should drive the application state here, so synchronization with the backend service isn't an issue - and the service is non mutating. But again, the OS is going to maintain just 1 TCP connection for that origin, and requests / responses will be in order, so it's kind of a meaningless example:
https://developer.android.com/topic/libraries/architecture/livedata
note that, if there were some scenario where you genuinely needed switchMap - maybe you had a custom protocol and multiple connections with the server you were managing - in this scenario if you were to just naively use switchMap() and send requests to a service on a background thread... you could end up sending these requests in any order, and they could be processed in any order, but you'd still only ever receive the second response on the client... if the requests are mutating it will result in your client falling out of sync with your service.
It's almost certain that you will never need switchMap. Certainly not if you're using TCP. The scenario in the docs is not even a valid use case for it, and the Android devs were probably just confused when they created it. But in general it is better to just use Flows in the domain layer.