The point of using /(?=(the .*? dog))/gi here is that look around assertions are zero length, i.e. after they match at position P, the next match is not searched at their end, but at the position P + 1, so you can find overlapping matches, as well.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Comment on Re^3: Pattern matching: Lazy vs. greedy