The clicking noise is caused by the grinding of the pharyngeal teeth. They will often make this noise while they are eating. I have also personally seen a B. Modesta use the sound as a defense mechanism to scare off another fish. In my opinion, one of the coolest part of owning loaches is dropping in some cichlid pellets or some mussels and listening them cause a racket in their feeding frenzy.