Applications are one of the most important utility in Android. They are classified into two types, system apps and user apps. System apps are the one that is preinstalled, and removing some system apps cause device instability.
]User apps are those installed from playstore or other sources and this application can be used along with internet or WiFi. On constant usage, application consumes them and creates application data and cache.
App data is the data user creates using the application. Deleting it when it reaches a certain size would be like Windows deleting all the documents. User can choose to clear an app's data through the Settings at any time, but this will delete everything you created through the app, except if the app syncs your things to the cloud, such as Google Docs. Usually, it's best to manage an app's storage through the app itself, which should offer more control over what user delete.
Cache is a temporary copy, of data that's safely stored in the device memory. It's up to the individual app to correctly classify things as data or cache, but you can expect that clearing an app's cache doesn't actually lose any data. It just means some things that were stored in the cache might need to be downloaded again. The only limit for how much data an app can have is how much storage your phone has. If you use it all up, you won't be able to install or update apps, or store more data. Clearing an app's data will make it lose its data, essentially removing progress in games, etc
User can usually copy the data for user apps without problem. User should copy the /data/data/ folder, since it will include system app data and provides no way to easily manage it. Applications like Titanium Backup can be used instead. With root, it allows you to easily backup any subset of apps, and then you basically copy over the backup folder to the new phone, install it and select the backup folder, and then restore everything in a single batch operation. They can be used to migrate apps and data in different types of Android.
On factory reset and restoring account from Google drive or other cloud applications, many things get restored correctly. Although some are not restored like themes and background picture, organisation of apps on home screen, alarms in clock app and cookies in chrome.