While the rule does not require that the position occur three times on nearly "consecutive" moves, it happens this way very often in practice, typically with one of the kings being put into perpetual check.