In this sentence:
She has too many students in the class to give them individual attention.
I wonder if the object 'them' is necessary to be inserted in the sentence as 'them' refers to 'many students'.
The object "them" is needed there, to refer to the students. Compare the original sentence with:
She has too many students in the class to give the rain attention (also).
So if "them" is not used, something else can be. And if nothing is used:
She has too many students in the class to give individual attention.
then the sentence is complete: give attention ... to whom? To what?