When the skull of Brahma falls from Bhairava's hand at Kashi, Shiva makes him the city's lord and keeper; he alone punishes those who sin in Kashi, so even Yama's messengers keep away, and pilgrims still go to ask his leave.
Shiva, angry at Brahma's pride, makes a terrible being and names him Kalabhairava, because even Time will fear him, and Papabhakshana, the eater of sins, and gives him lordship over Kashi for ever: he alone will punish those who sin there, and Chitragupta will write nothing down. Bhairava nips off Brahma's fifth head with a fingernail; the skull sticks to his hand through every holy place until he enters Kashi, where it drops at once, and he dances. Whoever remembers Kapalamochana is freed of sin, and the messengers of Yama fear his devotees.
His temple stands in Vishweshwarganj, rebuilt by Baji Rao II in 1817. Only his silver face shows; the rest is draped, and he sits on a dog. Pilgrims believe he gives leave to live in the city, and come to him on arriving and before leaving; a priest touches them with a club of peacock feathers and ties a black thread on the wrist.
Sources: Skanda Purana, Kashi Khanda 31, tr. G. V. Tagare (wisdomlib); Kaal Bhairav Mandir, Varanasi (Wikipedia); Kala Bhairava temple (Cultural Heritage of Varanasi); Kaal Bhairav Temple (Incredible India)