Quick explainer of what executive orders are (mostly for the benefit of folks outside the USA, since a lot of countries don’t have presidents):
The executive branch (the president) can’t make legislation. Laws are enacted by the legislative branch (Congress). However, people in the executive branch can make rules about how existing legislation is enforced and interpreted (executive orders are one example of how you do this), which can then be challenged in the courts if it doesn’t seem to conform closely enough to what Congress ordered.
So for instance if Congress passes a law about taxes that doesn’t mention the mechanism for collecting them, the executive branch could say “we’re doing it this way.” But if Congress specified a mechanism, the president would have to use that mechanism. And if he didn’t, or if he didn’t enforce the law at all, the government can be sued by the citizens affected.
If the judicial branch finds the executive branch has failed to faithfully execute a law, they’re in violation of the Constitution. In the past, when this has happened, the executive branch has changed what it was doing (and/or the Congress has withheld funding from the executive branch). If they were to elect to remain in violation of the Constitution, it would be grounds for Congress to remove the president or other executive branch officials from office (provided Congress cared enough).
Sometimes presidents issue unambiguously illegal executive orders to take advantage of the “grace period” between when the executive order goes out and when it’s struck down, which is essentially like withholding rent when you know it’ll take three months to evict you. They may also hope that during the court challenge the judicial branch will allow them some expansion of their powers (will point out some loopholes they can use).
So when Trump issues blatantly illegal executive orders, it could mean any of several things:
1. That he doesn’t know existing law well enough to understand the orders are illegal.
2. That he knows they’re illegal but wants them in effect until a legal challenge goes through, and/or to see whether there are any parts he can get away with, and/or to cause pain and financial strain for the people who will challenge the law, who will have to focus on that instead of other things.
3. That he knows they’re illegal, but figures that even after a legal challenge, he can continue to do what he wants because he believes civil servants will choose loyalty to him rather than to the law, and that a Republican Congress won’t impeach him because he’s so special and great (the “I could shoot someone on 5th Ave and not lose voters” strategy).
It could be any of them, really. Also, I’m not a constitutional lawyer (so if you see something way wrong, correct me in the comments). But for the benefit of people who didn’t have U.S. High School Civics, there you go.