At Casablanca Mohammed V airport, passengers connecting between two international flights can usually stay in the transit area without going through immigration.
The airport has 2 terminals or concourses (Terminal 1 (Egyptair, Iberia, Qatar Airways, TUI), Terminal 2 (Royal Air Maroc and most others)). All of them are connected after security, so you do not need to clear security again to change.
Connecting passengers go through a transfer security screening.