Rewrite the sentence to be simpler: They are closely related to the Megaloptera and Neuroptera.
The Megaloptera, Neuroptera (in the modern sense) and Raphidioptera are very closely related, forming the group Neuropterida.