Ultimately it comes down to these main types:
Injection - Works by adding your own code into the gamepack. Your added code are mostly just getters that return field information about the gamepack. It's done by manipulating the bytecode from some library like ASM or BCEL. Requires a client.
Reflection - Works kind of similar in regards to getting field information, but instead of actually injecting code, think of it just copying it into your own little space. After it's copied, you can read the data from it pretty much the same way as injection, looping through your hooks and reading specific fields. Requires a client.
OGL/DirectX interception - Intercepting the data on its way to the GPU. There, you have information about all the things that need to be drawn before they're actually drawn. you can generate IDs much like reflection/injection and do some pretty powerful things. Requires a client.
Screenscraping - analyzes the game using visual processing, essentially analyzing the color, shapes, et cetera. Some come with a client and some do not.
**Credit for Injection/Reflection/Interception explanations go to NKN