In case of Diablo 3, client sends to server almost everything: clicking on an NPC, clicking on ground to move, using a key to use ability, setting an ability, changing an item's place in your backpack (even though it has absolutely no effect on anyone and item positions could be safely stored locally - and only a list of items in backpack must be updated on server when you pick/drop an item, use it or give to someone). What isn't sent to server is e.g. moving your mouse cursor, minimizing your game or changing video resolution.
Server sends to client everything it should know - monsters in sight (in some games too soon, and that's why map hacks are possible there), actions of another players (or rather effects of them), and results of your actions: what item did you craft? what loot do a monster drop? did you attack critically or not? did you move or connection failed you and you still stand in the old place?
The failed connection scenario is the only reason a client and a server should 'disagree'. It happens sometimes in Diablo 3 because it's client is cheating the player. When You click somewhere on ground, your character moves instantly, even though you need at least 50 ms for request to go to server and back. When connection gets laggy, it's clearly visible because of gold picking, as client simulates only changing position of a character, and not picking the gold, hence sometimes you run through a gold piece and see it disappear after a few more steps. And in case of packets lose, the client will disagree with server as to your position, but as the server is always right, not the client, you will be teleported to where server says you should be. Such 'disagreement' is called a desynchronisation, and often makes a game crash.
When making a bot, language of the bot-client doesn't matter as long, as it supports the right technology to connect to the server. In case of Diablo it will be sockets, sometimes just a http POST or GET request to server. Just like with hacking, making bots are easiest when you test them on your own servers first. To put it simply, it's hard to play chess if you always play as black, and don't really understand the strategies of the white player (it's also hard to understand the analogy to chess if you didn't play them much).
White Player (W) makes a server, and a client
Black Player (B) makes an automated client
W encrypts data using some simple technique (xoring every character)
B decompiles the original client or guesses encryption method and implements decryption in his automated client
W makes the client always send his version to the server, and make it behave differently from version to version, then the server bans the client's IP if it doesn't act as expected for his version
B either looks into original client and updates his bot regularly, or never played as W and doesn't understand part of data (verid=1.5.2) and loses the game.
Bots are usually not hard to make, though when an admin looks into logs, they're often obviously visible.