Initially, Alfred discovered their identities by accident; while fighting a burglar in "Batman" #16 (Alfred's first appearance), he accidentally hit a switch and opened a sliding panel leading to the Batcave.