I click the back button of the device and close the application

Good morning guys, I need the following help.
I’m browsing the app and I click the back button of the application it returns normal.
But when I click the back button on the device (android specific), it exits the application.
I do not know how to specify technical forms, but what is happening and do not know where to begin to solve, please I ask for your help