binary = machine language. when programing, you shorten simple command line structures. so, we'll start at recent and go backwards in time here. programing is basically built on top of previous work. VB6.0, for example, isn't just ONE person, but the compilation of many. To make things shorter, people have writen what are called libraries (DLL's). So, for example, the if statement. Here is an example of code:
If optbutton1.value = true then
msgbox "I am awesome"
elseif optbutton2.value = true then
msgbox "I am still awesome"
end if
exit sub
this does a few things. you have a form with a radial button that has been assibned the name optbutton1 and another called optbutton2. the code above goes and says well, if the value of optbutton1 is true (meaning selected) then do this. but if optbutton2 is selected it will do nothing at that point, but continiue down the line of code. then it gets to the next if. well, this one turns out to be true, so it runs the msgbox nested in there. The If statements are now easy to do, but awhile back you would have had to written you own sequence of algorhythms to come up with this. as in, saying what exactly "if" is. but someone has already done this and need not be done anymore.
now, what happens is visual studio (or whatever programming code you are using) has a compiler. This, to make it simple, takes all you've writen and makes it ready for running. So that little code writen above MUST be compiled. This takes what I've just writen and breaks it down into something readable by the machine. Also called machine code (binary). 1's and 0's. You CAN technically write in machine language, but I would shudder to do such a thing as in that little bit written above would be HUGE because of the links to the library to define the If statement, would add to the code, as would msgbox, etc.
so, modern programming is just a simpler way to interface with machine language in a more friendly way, and do it much quicker.
Now as far as how does word know this is a space? Its built into the programming language and the .DLL (dynamic link libraries) built into the operating system. Thats what the o/s also does. Most common controls will be easily understood when writing applications. If you want to get exotic, though, and change the norm of what a space bar does in word, then you HAVE to write it in code. So, for example, I wanted to change what happens when space is pressed in a program I wrote (say my own generic word program). I would write the parameters in the main body of the code itself. That way, when you load up my program, it will temporarily remap and redifine what certain keystrokes do.