It uses both methods, so that not every game needs integration to show up. If I recall correctly, you can just add arbitrary executables to the list. Set it to some system daemon like ntpd and it might say "has been playing ntpd for 49 hours" on your status.
Nope. Games can do that to provide richer information, but Discord Desktop does scan your process list and even let's you chose which software to show or add a custom new one from the process list.