Either, Check the apps section in developer options. Maybe you have turned on 'dont keep activities' or other options below it. Or You may have added apps in sleeping apps / deep sleeping apps categories which is in Settings- battery and device ca...