It's been a while since my CS degree, and I wasn't that great of a student to begin with, this is more of a comp eng question, I only took one 2nd year course that would help answer this question so I forget a lot of details, and am a little drunk now, but here we are.

Through the magic of logic gates implemented physically via wires and transistors and stuff, we have bits represented as voltage, where 0 is ~0V and 1 is ~5V, and adders:

http://en.wikipedia.org/wiki/Adder_(electronics). They are used everywhere in computer hardware to perform basic arithmetic.

Skipping some steps... CPUs have instruction sets which define how every series of x bits thrown down the pipes are to be handled...many logic gates to throw the voltages around various tiny wires and transistors and stuff. A "32bit" architecture has the first few bits reserved for the instruction code, the next bits is the data for that operation (and then some other stuff probably), so a 64bit architecture has more room for bigger numbers (which is important for memory addresses and stuff, see: 32bit windows and 4+GB of ram).

See: http://en.wikipedia.org/wiki/X86_instruction_listings or http://en.wikipedia.org/wiki/X86_assembly_language cuz x86 is a common example of a CPU instruction set, but there are many, and all hardware specific because the instruction processing is physically hardwired into the CPU itself via transistors and stuff. Some instructions are simple arithmetic, some instructions are like...save this data in this RAM, some instructions are go fuck your mother.

The CPU interacts with the video card via the motherboard using... "special instructions" that tell the CPU to tell the motherboard to tell the video card to do stuff like how to color the pixels right and stuff. It knows how to tell the video card stuff cuz drivers.

TLDR: magic