How does the pathfinder in warcraft3 work?

I’m not sure the way of pathfinding in warcraft3.

I found that when i ask a grunt goes from A island to B island ,it can find a way ,but the way isn’t correct.Finally, the grunt will stay in the border of the A island.

have any information about the way of pathfinding in warcraft3?
thanks