How Do These Kind of Power Switches/Systems Work?
A power button as you described is not a power button. It is a button that triggers a set of code like any other normal button. It uses the same logic as any other button you include in a project.  The microcontroller either polls or has an interrupt that checks for a change in the button and then follows the code you have programmed into your project.
For the most part the code tells things to stop doing anything or send specific commands then puts itself to sleep and the only other thing it should do is wait for another button press to start doing things again. Nothing special about a soft power button.