A bat gate is a series of horizontal bars, tightly spaced and supported by a minimal number of vertical members, set across the entrance to a cave. The purpose of a bat gate is to prevent access to the cave by anything larger than a bat, such as predators and curious humans. Contrary to how it might sound the bat gate does not actually open. It's more of a fence, but "bat fence" would make it sound like it's intended to keep the bats out.
Bats are important parts of the ecosystem in many areas, pollinating flowers and consuming massive numbers of insects. Unfortunately their habit of hanging out in interesting places during the day leads to disturbances by human explorers and vandals while they're trying to sleep. This could lead to all kinds of problems for the bats, ranging from being mildly bothered to deciding the cave is no longer a good home and leaving for good. It also has the effect of keeping out large natural predators who might think bats look tasty. One common use for bat gates is to repurpose old, payed-out mines for bat habitats.
The bats themselves are agile flyers who can see the bars clearly with their sensitive sonar. They have no trouble flying between the bars to get in and out. However it's important to remember that bats aren't the only natural residents of caves. Depending on the cave, you might find all manner of invertebrates, amphibians, reptiles, and even large mammals. Unavoidably, a bat gate will have a serious effect on cave populations as a trade-off to keeping the bats and their delicate habitats safe. Anything too large to fit between the bars will obviously not be getting in, but the effect of bat gates on smaller, non-bat animals that like to live in caves is not currently very well understood.
As humans continue to destroy natural ecosystems and encroach into wilderness, bat populations suffer because their habitats are destroyed or modified. Bat gates are a good compromise that allow humans and bats to share the planet, so we can continue to enjoy the benefits that they offer as pollinators and insect control.