Soccerman,
the Operating System (which in turn is a program itself)
will take care of the difference between numbers and letters
if that what you mean.
Computer only sees machine code or binary code.
All numbers and letters will be converted into binary.
So the string "ABCD", is represented by 4 8-bit bytes + 1
byte for null to indicate end of string.
"ABCD" is 0100 0001 0100 0010 0100 0011 0100 0100 0011 0000
This binary code will be stored in disk or memory.
Whenever it is needed, it will be loaded (the OS should take
care of this), like it will load 5 8-bit bytes from location
100 (if this is the place where it was stored).
A number will be converted into binary code as well.
So the OS should take care of this difference, it knows
when something is a number and when another thing is a
letter (if it doesn't know, then the OS is dumb or the programmer
is dumb ).
For programmers, when you program, you do know when input
is a number or letter right ? (well at least you expect
it to be number or letter, otherwise you will report errors
when you compile the program). OS (is just a program) should know the difference between the two,
this information will be passed to compiler. Then compiler will
generate machine code, at this stage no informations are
stored about something is a number or not, but everything
has been already lay out nicely.
Keys in the keyboard will eventually be mapped into binary
code, or they might already have from the beginning (I'm
not sure how keyboard works but this is my guess), since
whenever you type something in the keyboard, signals (in binary)
are sent into OS via interrupt.
Just remember that everything you type CAN'T be understand by
computer, it needs program (OS) to translate this to language
that the machine understands.
Everything you do (type) in computer will be translated into
machine codes. First OS will translate this to instructions
(assembly code), second these instructions will be translated
into binary (machine code), and machine will use this machine
code to execute/run.
Oh btw, I should make a note that these machine code are differ
from one architecture to another.