The first space enigma was the fact that vision lives in the two dimensions of Flatland, but produces an experience of three dimensional Spaceland. You can't logic or experience your way from Flatland to Spaceland (as described in the famous book). Berkeley tried to solve this problem by providing a guide, in the form of the Spaceland-dwelling body, but this fell apart and the only remaining suggestion was an unrepayable loan of intelligence from God.
Another way to consider this problem that leads to another proposal is what Turvey calls 'the outness problem'. This is the annoying fact that sensations on the retina are experienced as things out there, in the world. This makes space a necessary precursor to perceptual experience: however the outness problem is solved, a notion of space is required to drive the search for a solution. Kant is the main person who worked to establish how space might be baked into perception; 'Space, therefore, is not an object of perception...but something very different, namely, a mode of perceiving objects' (Turvey, 2019, pg 124). Spoiler alert: it doesn't work, for interesting reasons that feed into the development of the ecological analysis.