When you par with a phone for the first time, you need to enter the passkey. (If you do not see the passkey window, it might sometimes come up in the notification bar of your mobile. You need to drag down to see the window).
Once paired, the pairing information will be stored in the mobile. This is called bonding (You can see this in Bluetooth Settings -> My Devices). If the pairing information is also stored in the device (bonding option enabled in the firmware), you do not have to enter passkey everytime from then on.
If the bonding info is done in mobile and not in the device, you might have to enter the passkey again or the pairing may fail depending upon the scenario.
If you remove the bonding info in the device (during reprogramming the firmware or manually removing bonding info in the firmware), you might have to remove the same in the mobile also. (In Bluetooth Settings).
Refer to the below example project for bonding.