You are blind and from the hints you get by moving around (for example hiting a wall you stay at the same place) you try to reconstruct the map on paper. And then you can validate by pressing "Chart".
For example in the gif you posted you started in the top left corner which is a hole. A hole brings you to a connected hole. In your case the connected hole turned out to have another hole exactly above it (#2). Then you pressed right a bunch of time so you looped between the holes labeled "2" until you escaped by pressing bottom to a free space. And so on. The readme explains the logic of different tiles you can encounter.