This feature can be turned off / On....
Leak detector app (If it is a third party app) will surely get offloaded if not used for more than 12 days.
All Apps that can be removed will get offloaded after a brief period of non-usage --> Remove built-in Apple apps from the Home screen on your ...
Offload ("undownloading")Apps --> Happens automatically, when an app remains in your device unused for more than 12 days the app is offloaded automatically but the App data remains.
This is mainly used to free up space on your device
You can make storage space available on your iPhone, iPad, or iPod touch when you use iCloud Photos and turn on Optimize Storage. Or you can remove content from your apps—like photos, music, and Podcasts—or delete the apps that you're not using.
- Settings > [Tap your Name] > iCloud > Photos > Optimise iPhone Storage (Refer Pic 1}
- Settings > iTunes & App Store > Offload Unused Apps [Enable] (Refer Pic 2}