"If students ask more questions, they will understand the lessons better."
I'm not sure what the the subject in this sentence is, and if it's a simple sentence or a compound sentence, but I think "students" is the subject, and that it's a simple sentence because there's no coordinating conjunction. Correct ?
ONLY A NON-TEACHER'S OPINION
(1) You are a learner; I am a learner. We learners like to parse (analyze) sentences. don't we!
(2) Let's put your sentence into "regular" order:
They will understand the lessons better if students ask questions.
(a) The main clause is "They will understand the lessons better."
(b) The subordinate clause is "If students ask questions."
(i) We know that it is a subordinate clause because it starts with a conjunction ("if") and because if you walk up to a stranger on the sidewalk and say only "If students ask questions," the stranger will think that you are crazy. That's why some teachers like to use the word "dependent" clauses instead of subordinate clauses. That is, they are "dependent" on the main clause to make sense. (Just as a child is dependent on his/her parents.)
(c) If you have one main clause and one or more subordinate/dependent clauses, most books classify such a sentence as complex. (I have enough confidence to say that your sentence is definitely NOT "simple" and NOT "compound.")
(3) The main subject is "they."
(4) The subject of the subordinate clause is "students."
(5) I think (repeat: think) that if your teacher asks "What is the subject of this sentence?" she/he is referring to the main subject.