The atomic group prevents backtracking into itself, and forces the next lazy pattern (.{1,5000}?) to make possibly an enormous number of successive, tiny steps from a fixed (and potentially "bad") position. The non-atomic alternative allows backtracking so that it can reposition the bbb match economically, sometimes pruning the search more quickly and not reaching the total step limit, although it does technically involve backtracking steps.