If you say "all apples" without using "the", then you're talking about every apple that exists in the world.
Example: "All apples are green." Here you're literally referring to all apples.
If you use "the", then you're talking about some specific apples. But whether you say "all OF the apples" or "all the apples" doesn't matter. The "of" doesn't change anything about this sentence.
Example: "All the apples (on this tree) are green" and "All of the apples (on this tree) are green". They mean the same thing and sound equally correct.