Die Lehrer freuen sich über den Erfolg ihrer Studenten.
What I don't understand about this sentence is, den Erfolg is accusative but then why Studenten takes ihrer, dative? I know that ihrer here is a pronoun but why is it not ihre Studenten, why not accusative? Is it about über, but if so how can I understand which object takes accusative and which one takes dative?
Thank you for your help.