Is applicationShouldTerminate called by the system?

My (Swift) macOS app is periodically & unexpectedly getting applicationShouldTerminate. At a guess it happens once every few days, and the even odder thing is that the app is not quitting in response to this; in my dock it's still showing as running (dot under its icon). When I click its Dock icon, the app goes into applicationDidFinishLaunching and starts up as if it had indeed been quit.

The pseudo-termination is happening without any user interaction. Does macOS ever call an application's applicationShouldTerminate, perhaps to free up resources or something? If not, any other ideas regarding what could cause this behaviour?

Is applicationShouldTerminate called by the system?
 
 
Q