Android typically forces low-priority apps to sleep so that they don't drain your phone's battery. Putting apps to sleep means they won't consume a lot of power and won't run in the background ...
Go to Settings, select an app, and use Force Stop to stop it from running. On Pixel phones, turn off Allow background usage; on Galaxy phones, choose Restricted to save battery. Developer options show ...