To understand the origins and geological formation of the cavity, we must go back 40 million years ago, when the land that is now part of the Conca de Barberà was part of the seabed of a great sea, where the rounded pebbles from the rivers and ravines that flowed into it were deposited. Twenty-five million years ago, the waters of this sea were displaced and in their place there was an extensive marshy plain. Over time this marshy area dried out and the boulders and sediments that had formed part of that ancient seabed became compacted, turning into a solid, hard rock, which we know as conglomerate.
Since ancient times, rainwater and melting snow from past glacial periods, as well as the presence of the lush Poblet Forest that acts as a sponge, have given this area an important degree of water retention. Most of this water flows towards the Pla de la Conca, forming a series of streams and ravines such as the Titllar, the Torners, the Fargues, the Pena and, mainly, the Castellfollit, which gathers the waters from the slopes of the Argentada and the Tossal Rodó.
Most of the water collected and transported by all these streams and ravines converges in the holm oak grove of La Mata, an area formed by sandy materials with a great filtration capacity, which acts as a large field of sinkholes through which the water seeps into the interior of the earth. This circulation of subway water caused the wear and tear of the conglomerates and the opening of various fissures or fractures, which led to the formation of a whole network of conduits and galleries through which a real subway river began to flow.