Behind the scenes, there’s no such thing as a for loop or while loop. It’s a bunch of gotos in intermediate code, LLVM br-anches, and ultimately native jumps. You can check with Meta.@lower or the @code_### reflection macros.
And no. First, your version omits the iter variable and adds extra stuff like @show, which are generally liberties you should avoid for documentation. Second, the for loop does not create a global variable next or the local variable state/index*, so it’s obviously not the same as the while loop on the language level. “Equivalence” here means that a for loop uses the iterate function, provides the items via the iteration variable, and hides the state in a way that would be more visible in a while loop that accomplishes the same thing with extra variables. You can also see this in lowered code between the gotos.
*Together with this, your replacement of state in the documentation with index implies you think iteration states are the item’s indices. Indexing is implemented by a separate interface, and there is no requirement for iterables to implement indexing, let alone use indices as iteration states.
That question is actually asking about an entirely different aspect. Even if it weren’t, avoid linking topics unless your topic needs a quote or context because your topic’s links also create a mirroring link from those topics, which becomes progressively more confusing for other people looking up those topics in the future.