The cave was discovered and used long before by Bruce Wayne's ancestors as a storehouse as well as a means of transporting escaped slaves during the Civil War era. The 18th century frontier hero Tomahawk once discovered a gargantuan bat (owned by Morgaine le Fey of Arthurian legend) inside what can be assumed will become the Batcave. Wayne himself rediscovered the caves as a boy when he fell through a dilapidated well on his estate, but he did not consider the cave as a potential base of operations until he rediscovered it yet again when he returned to Gotham to become Batman. In addition to a base, the Batcave serves as a place of privacy and tranquility, much like Superman's Fortress of Solitude.
In earlier versions of the story, Bruce Wayne discovered the cave as an adult. In "The Origin of the Batcave" in Detective Comics #205 (March 1954), Batman tells Robin he had no idea the cave existed when he purchased the house they live in. He discovered the cave by accident when testing the floor of an old barn on the rear of the property, and the floor gave way. This story also established that a frontiersman named Jeremy Coe used the cave as a headquarters 300 years earlier. Bruce Wayne discovering the cave as an adult remained the case at least through Who's Who #2 in 1985.
Upon his initial foray into crime-fighting, Wayne used the caves as a sanctum and to store his then-minimal equipment. As time went on, Wayne found the place ideal to create a stronghold for his war against crime, and has incorporated a plethora of equipment as well as expanding the cave for specific uses.
The cave is accessible in several ways. It can be reached through a secret door in Wayne Manor itself, which is almost always depicted as in the main study, often behind a grandfather clock which unlocks the secret door when the hands are set to the time that Bruce Wayne's parents were murdered, 10:47 pm. In the 1960s Batman TV show, the cave entrance is behind a bookcase which was opened when Bruce Wayne activated a control switch hidden in a bust of William Shakespeare; when the secret switch is turned, the bookcase slides to one side, revealing the "Bat-Poles", which allow Bruce Wayne and his ward Dick Grayson to change into their Batman and Robin costumes en route as they slide down to the cave. An entrance under Bruce Wayne's chair in his office in Wayne Enterprises, as shown in Batman Forever, connects to a miles-long tunnel which Bruce travels through in a high-speed personal transportation capsule. In Batman Begins and The Dark Knight Rises, the cave is accessible through a secret door disguised as part of a large display case and is unlocked by pressing a sequence of keys on the nearby grand piano.
Another secret entrance, covered by a hologram, waterfall or a camouflaged door, allows access to a service road for the Batmobile. Another alternate entrance is the dry well where Bruce originally discovered the Batcave, highlighted especially during the Knightfall comic book storyline. At one point, Tim Drake and Dick Grayson use the dry well to get into the cave, which they had been locked out of by Jean Paul Valley during his time as Batman, and Bruce Wayne used it to infiltrate the cave and confront the insane Valley in the final battle between the two men for the title of the Batman. Lured into the narrow tunnel, Valley was forced to remove the massive Bat-armor he had developed, thus allowing Wayne to force Vally to remit his claim to the title.
The location of the cave is known not only to Batman, but to several of his allies. In addition to the so-called "Batman Family", members of the Justice League and the original Outsiders are aware of the cave's location. Essentially, anyone who is aware of Batman's secret identity also knows the location of the Batcave, much like how people who have knowledge of Robin's identity have knowledge of Batman's; these, unfortunately, include such villains as Ra's al Ghul, who makes occasional visits to the Batcave to confront his long-time nemesis, and David Cain, who infiltrated the cave during the Bruce Wayne: Fugitive comic book storyline when he framed Bruce Wayne for murder. During Batman: Dark Victory, Two-Face, the Joker, Mr Freeze and Poison Ivy discovered the Batcave while fleeing through the sewers to escape the attacks of the surviving mobsters, but they had lost their way and were never able to find the cave again after being defeated by Batman and Dick Grayson (In his "official" debut as Robin), Batman reflecting that he would seal that entrance to prevent such a thing happening again. When the powerful Bedlam took over the world and transferred all adults to a duplicate Earth, Robin attempted to assess the situation from the Batcave with Superboy and Impulse, but it would appear that he avoided revealing the cave's exact location to them, suggesting that he accessed it via an external passage or a teleporter. After Bruce Wayne's 'death' during the Final Crisis, Two-Face manages to infiltrate the cave with the aid of a psychic analyzing a batarang to 'sense' where it was forged and then hiring Warp to teleport him into it- something he had never been able to do before as Batman used various spells and equipment to shield the cave which his allies either never knew about or have discontinued as they no longer use the cave themselves- but Dick Grayson, acting as the new Batman, is able to convince Dent that he is the same man and has just adopted new methods.
Although Wayne Manor was repossessed and converted into the new Arkham Asylum following the events of Batman Eternal, Batman maintains the original cave after sealing off the entrance to Wayne Manor, musing that it is a good opportunity to keep his foes contained. After the manor was gifted back to Bruce by Geri Powers. Alfred kept the location of the Batcave a seret from Bruce who had lost his memory of being Batman in his last battle with the Joker. While the manor was being renovated and all the Arkham inmates were removed Bruce and Alfred until then remained in a Brownstone in Gotham itself. Even after Bruce loses all memory of his life as Batman, the cave was still used by other members of the Bat-Family; Alfred took the de-powered Clark Kent to the cave to explain what had happened to Bruce, and Dick Grayson and the various Robins used it as a base of operations while opposing the schemes of the ruthless "Mother" in Batman and Robin Eternal. When new villain Mr Bloom launches a massive attack on Gotham, Alfred is forced to allow Bruce into the Batcave to access an apparently-disregarded program designed to upload Bruce's memories to a series of Batman clones to maintain his legacy, Bruce overcoming the original project's limitation of being unable to upload the memories to a fresh body by having Alfred take him to the point of brain death and then download the data onto his blank brain.