My best guess on how people discovered this: by-product of limited clay technology. Before people understood how achieve temperatures high enough to vitrify clay, melt glazes, or discovered glaze composition period, all clay would have been in a very porous state after firing...especially after the relatively low temperatures produced in open pits or simple updraft kilns. It would be pretty apparent fairly quickly that water would seep through the clay with- like the coolers you mention in Afghanistan. They knew pots needed to be sealed and employed all manner of other techniques: tar, sap, natural resins, wax...until glazes and higher temperature kilns/firings were discovered.
How long will they keep a bed moist?
In summer, I find that these pots (1 gallon size), staggered 1 at the center of every 2-3' radius reduce watering from daily to every other day/3 days. Mulch and chips to prevent evaporative loss through the bed surface is key though. To make it a week, I'd install drip. It's actually very easy and pretty cheap to do- plenty of online tutorials.
Side note: Aside from cooling water, the porosity of clay is being used with great success for treatment of water in less developed countries. A thick clay pot is nested at the mouth of a 5 gallon bucket, filled with water, the water slowly drips through, filtering it. The clay has been brushed with colloidal silver, which neutralizes viruses/bacteria, while the clay strains out bigger pathogens. An easy to make, cheap solution to water contamination that many aid groups are teaching people to produce locally. Basically just a large, simple version of a backpacking ceramic filter. I know some groups that have been active in helping set up local shops for these in Nicaragua, Guatemala, and Yemen.