Most lines here are -겠거니, which marks an assumption the speaker made without checking, usually one that turned out wrong: 알아서 잘 따라오겠거니... 'I figured they'd just follow along fine.' The remaining lines are the fixed exclamation 옳거니!, an old-fashioned 'aha, that's it!' shouted when something clicks. Both are common as captions; the assumption use is the one you can build sentences with.