Answer:
It's an unique string that identifies your app.
It is usually written in reverse DNS notation i.e (com.Yourcompanyname.yourApp).
Bundle IDs should be app specific (either iOS or macOS) and it can't be used for both iOS and macOS apps.
Bundle ID can be set in your project's target as follows​
as follows.
Objective-C
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
Swift 3.0
let bundleIdentifier = Bundle.main.bundleIdentifier
Read:
What are best practices that you use when developing projects in Objective-C ?
Top 5 most common Xcode Errors solved