The client (your end) sends out and receives information from the server...
Basically, In short...
You run Around, which changes your X, Y, Z... this is only a few bytes of data.
Your friends by you, are also running around... They are uploading theyr XYZ, and Downloading yours...vice versa.
OTHER information is also computed via the Server, and some by the Client.
Now, MOST mmo's have anti hack software on the server side of things, and possibly the client side...
For example,
If you used a Speed Hack, Ok, 500% run speed is impossible... Red Flag you. Now, obviously, there are coincidences. So, if you get so many 'Red Flags', they will ban you for..speed hacks.
The BIGGEST thing that people are getting busted for, is other players and/or GM's watching you.
Sure, I can "report" you... but maybe you arnt botting.... I'm just a guy who you stole his loot from.
But, if 5 People report you... ok, they will review LOGS. (Location, time played, etc).
It is best to bot in unpopular areas... and if you do... constantly check your screen for tells.
If you play for 97 Straight hours, without skipping a beat... ya, chances are, you're botting.
As far as legalities go, theres not much you can do about it minus taking them to court, and having their records subpoena'd.
It can easily be won in court, as they would have to prove that your account was infact using a third party bot program which resulted in the loss of your account.
However, I am sure in the TOS/AUP, it says that even if hacked, your account is still your responsibility... Which makes it easy for them to prove..
So even if you're from the USA...and someone from China uses the bot because they hacked your account...and your account got banned.... It still falls onto you.