What are the small lumps in the mouth of the fish, and what is its function?
Yes those are teeth and some have them and some do not for the same reason some have sharp teeth wile others have flat scrapper teeth, it depends on their diet. 

this kind of teeth are called molariform, and are used for crushing shellfish more than anything else. This slide show will help you, https://www.ru.ac.za/media/rhodesuniversity/content/ichthyology/documents/Anatomy%20Lecture%207.pdf