I realise that 'elephants' or any other noun representing a class, may be treated as a compound noun used as in the singular sense.
I saw the following in National Geographic. Is it correct?
Elephants are vegetarian and have a small tail.
On the other hand, yes, when you say “elephants”, you refer to the species.
If you said “the elephants”, you would be referring to a particular group of them.
I'm not sure of what your question is, but nouns representing a class are not compound nouns (these can be: ice-cream, bedroom..) but a generalization.
If you wish to englobe every elephant in the world you can also say "The elephant is vegetarian and has a small tail".