مَا ضَرَبَ زَيْدٌ إِلَّا عَمْرًا
Zayd struck no one except Amr.
Here the object is restricted. The action and its agent are fixed, while the other potential recipients of the action are excluded.
Compare “No one struck Amr except Zayd.” That restricts the agent instead. The case endings and construction determine which participant is being singled out.