Sure, they are not published illegally. IANAL but as I understand the process, is like this: the author submits to arXiv and either (a) gives arXiv a perpetual NON-EXCLUSIVE licence to distribute (which does not change the fact that the copyright is with the author) or (b) the author chooses a CC-BY licence. The author submits the article to Journal and after acceptance, may transfer the copyright to Journal. Is perfectly legal and it works like this for a significant part of the arXiv articles. See also here in the comments for cases when a revised version of the article from Journal is posted on arXiv. But now, with the new EU Copyright Directive, how will this delicate process interact with the dumb one-size-fits-all automatic filters which may detect (wrongly) that the article on arXiv infringes the copyright of the Journal. What if arXiv will receive a bombardment of requests from various Journals? What will they do? They are admirable but they don't have the surface to fight this ddossing from journals. Or maybe my concerns are void, I'd be very happy if this is the case.