Every given X seconds following conditions are checked:

if Jenkins is in shutdown mode
if the plugin is on
if the buildable queue is not empty

If these conditions are satisfied, appropriate logic is being done.