The microscopic workforce that transforms old plant parts into compost must have water to do its job, so compost often needs as much water as actively growing plants need. Locating compost close to a water supply makes replenishing moisture fast and convenient, or you can try snaking a soaker hose through an open heap as you build it.
New compost usually needs much more water than compost that is partially rotted and making good progress. In fall, pause to dampen layers of leaves as you add them to your compost, and do the same with withered plants gathered from your garden.
In summer, many composters cover open heaps with mulch, tarps, or old blankets to limit evaporation. Even when left uncovered, the interior of established compost piles tends to retain moisture well. Enclosures of any type, from wood pallets to concrete blocks, also help compost retain moisture.