What is the difference between App ID and Bundle ID in iOS and macOS

Bundle ID:

They are the unique identifiers of applications in Apple’s ecosystem. In other words, no two applications can have the same identifier. The bundling ID is used for both OS X and iOS apps and can be used to recognize app updates.
 

Example:

If our organization’s domain is scaler.com and we create an app named Edge, you could assign the string com.scaler.edge as our app’s bundle ID.
 

App ID:

This string uniquely identifies one or more apps from the same development team. There are two components to the string, the Team ID and the Bundle ID, separated by a period (.). Apple supplies a Team ID to identify a specific development team, whereas developers supply Bundle IDs to identify a single app or a collection of apps.
 

Example:

ABCDE12345.com.scaler.edge
In the above example, ABCDE12345 is the Team ID and com.scaler.edge is the Bundle ID.