As with other spirits in folklore, there were particular customs associated with them. Whistling and swearing were forbidden, and anyone eating underground should leave a few crumbs for them. Westwood and Simpson record the consequences of failing to do so: sick of the noise they made, a miner called Tom Trevorrow threw a handful of stones in their direction and then sat and ate all of his supper - ignoring the stones thrown back at him and the calls to leave them some of his supper. The knockers cursed him. He was followed by bad luck ever since and forced to leave the mine.
Stories of the origins of knockers vary. Sometimes they're seen as fairies or spirits, and sometimes as the ghosts of Jews "who could never rest because they were guilty of Christ's death" (The Oxford Dictionary of English Folklore). One in particular, in St Agnes, was said to be the ghost of a young woman called Dorcas who fell down a mineshaft and died. They also are sometimes associated with the followers of Edric the Wild.