To add on to what @Dave said, there’s a post with some more details about this feature, along with some images and gifs, in this thread.
In particular, I think the gifs @Ben posted in this reply on that thread explain it very nicely:
Also, it’s been improved and sped up quite a bit by @Miguel since it was initially introduced in version 0.8.0.0!