then why it happens only in arid soil?
Because this is what happens to calcium carbonate in wet environments:
It dissolves away, forming a cave. Calcium carbonate, or calcite, is soluble in mildly acidic solutions. Rainwater is mildly acidic because of CO2 from the atmosphere dissolving in it, so it never allows for the formation of calcium carbonate deposits in the soil to begin with.
As for why it forms in arid soils, the Wikipedia page for Caliche explains it well:
Caliche generally forms when minerals leach from the upper layer of the soil (the A horizon) and accumulate in the next layer (the B horizon), at depths around 3 to 10 feet under the surface. It generally consists of carbonates in semiarid regions—in arid regions, less-soluble minerals form caliche layers after all the carbonates have been leached from the soil. The deposited calcium carbonate accumulates—first forming grains, then small clumps, then a discernible layer, and finally, a thicker, solid bed. As the caliche layer forms, the layer gradually becomes deeper, and eventually moves into the parent material, which lies under the upper soil horizons.
However, caliche also forms in other ways. It can form when water rises through capillary action. In an arid region, rainwater sinks into the ground very quickly. Later, as the surface dries out, the water below the surface rises, carrying up dissolved minerals from lower layers. This water movement forms a caliche that tends to grow thinner and branch out as it nears the surface. Plants can contribute to the formation of caliche, as well. Plant roots take up water through transpiration, and leave behind the dissolved calcium carbonate, which precipitates to form caliche. It can also form on outcrops of porous rocks or in rock fissures where water is trapped and evaporates. In general, caliche deposition is a slow process, but if enough moisture is present in an otherwise arid site, it can accumulate fast enough to block a drain pipe.
(photo from http://www.naturephoto-cz.com/karst-cave-photo-24442.html)