tl;dr: How not to come off as boasting, arrogant, attention seeking, etc. if you are one of the few students participating in class?
I am currently attending a Master's level course where in-class participation of students is quite low. Typically, very few questions get asked by the students. When the lecturer asks a question to check if the class is following (or rather: at least not sleeping), the same 2-3 students provide the answers.
I try to participate actively: I'm not afraid of giving a wrong answer or of "looking stupid" by asking a question that can easily be answered. This however sometimes leads to me answering most of the lecturer's questions, which - I think - discourages other students to ask questions in the lecture (after all, who wants to announce that they didn't understand something when there is somebody else in the class who apparently did?) This in turn might lead the lecturer to falsely believe that everyone is following (not really my problem), but it might also lead to me being perceived as boasting, arrogant, attention seeking, disruptive (without ill intentions), etc., which I want to avoid.
I realized a while ago that I do like the attention and since then I try to evaluate whether a question/comment is really helpful before actually asking it. I also avoid answering the lecturer's questions immediately so that other students have a change to answer (or feel pressured to do so because of enduring silence ;)). On the other hand, I do not want to sell myself short and I do not want to be perceived as being arrogant because of not bothering to answer.