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}