If you would have defined the iteration condition like for i in 1:10 then i==10 will be the iteration end condition.
See that iterate(iter, state) == nothing is the condition for iteration end.
May be this post can be of help Understanding iterate() documentation is tough.