AT commands allow giving instructions to both mobile devices and ordinary landline telephones. The commands are sent to the phone's modem, which can be a GSM modem or PC modem. Different manufacturers may have different sets of AT commands. Fortunately, many AT commands are the same. Mobile device manufacturers may also give attention to operators to allow or not to allow some commands on phones.
AT commands can be used for operations that are usually done from the keypad, for instance calling a number, sending, reading, or deleting an SMS, setting the SMSC number, looking for a GPRS access point, reading and deleting phonebook data, reading the battery status, reading the signal strength, and so on. When you want to make a PC-based application to interface a mobile phone using USB, IR, or Bluetooth, these commands are needed to communicate with mobile phones. Basically such commands are the application layer of MBUS or FBUS commands.
If you want some story about the Hayes/At commands: http://nemesis.lonestar.org/reference/telecom/modems/at/history.html
I want to focus this article on Android and At commands.
It's not possible to communicate directly to the modem because there is a daemon taking care about the communication (linux basis), its name is RILD.
So the At Commands are sent/recvd between the RIL impl and the mobile’s baseband.