What actually happen if we click the power button in iPhone?
When you press the sleep/wake button, you simply turn off the screen (and lock the device). Audio will still play when the screen is off, but video will stop. Everything else that the phone does will largely be unaffected. Background processes like navigation, audio playback, alarms, etc. will function like normal. Calls, text messages, and notifications will still come in.

Source
https://a248.e.akamai.net/7/248/51/20120908/manuals.info.apple.com/MANUALS/1000/MA1565/en_US/iphone_user_guide.pdf