Consider how exceedingly stupid computers are (including that subset we know and love, microcontrollers). They need to be told just about how to do everything 
ASCII characters are received one character (or byte, since in this case characters are 8 bits, same as a byte) at a time via the serial interface. Every time Serial.read() is called, it returns the next character, unless there are none, in which case it returns -1. (Note that Serial.read() actually returns an int, which is 16 bits, but let's ignore that for now.)
Now we humans will type numbers as a string of ASCII characters. Consider some of the problems the processor has in interpreting the input. All these need to be addressed* in the code that processes the incoming characters. (1) How will the start and end of the number be determined? I might want to enter the number 42. I might type the 2 one second after the 4, or, if the phone rings, several minutes after the 4. How shall we interpret the "-1" condition? (2) Can I just enter "42", or is "0042" allowed? Is "42.00" allowed? (3) What shall we do if I type "00A2"? (4) Note that up until now, the unspoken assumption has been that the number is entered as a base 10 number. What if I want to enter a hexadecimal number? (may not be a consideration for your example). (5) What if I want to enter more than one number (ditto).
*Addressed may mean simply making an assumption, or it may mean complex and robust coding.
Now I've made it more complicated than it absolutely has to be, but the point is to appreciate that interpretation of typed input is not necessarily a trivial problem. In general, we need to check syntax, possibly the range of the entered value, and react accordingly. Assumptions can be made that will simplify the coding considerably, but the code may be more error-prone as a result. In this case we could assume the number is always typed as exactly three characters, and that all those characters are digits, 0-9. There are several failure modes here. If more or less than three characters are entered, we may not get the intended value. If letters are entered, we may get an error or invalid value. With three digits, we can enter values that are inappropriate for analogWrite(). But for a first pass in a testing situation, these assumptions may be perfectly fine.
Hope that helps. Not to brighten your day too much, but consider that people have died as a result of mishandling of human input by the code in computer-controlled radiation therapy machines. Google "Therac 25".