Harry's struggles in class could be due to distractions from outside events, or maybe he has a hard time concentrating on the subject matter. Also, there might be tough exams or demanding teachers that make it difficult for him.
Harry might have trouble understanding complex magical theories or fail to keep up with the pace of the lessons.