How does AT commands work? are they interpreted on the modem drivers? or are they interpreted inside the modems?
AT commands are used to instruct a modem in a standard way. In most cases AT commands are interpreted within the modem by its firmware. But sometimes drivers emulate/translate some commands. See wikipedia for more
The modem application layer interprets them.
Drivers control hardware and resources.
So if you pass an AT command to the modem, the application layer will interpret it and execute it.
Where necessary, the application layer will in turn pass the relevant command(s) to the relevant driver, or the command might just be at the application level.