Using the default for Android 15, these Google apps show a home screen preview when sliding. The shrinkage of the current window makes people confirm that they leave an application that prevents unexpected closure. This feature works when you swipe from the left or right edge of the screen.
It's been Google's year-long effort, starting with Android 13 and finally enabled by default in Android 15, which previously required a developer option. Meanwhile, the app also has a prediction feature where developers can create custom transitions/animations. For example, Gmail has implemented returning to the inbox from email, and Google Calendar has the same implementation for closing an event.