analogWrite() outputs PWM (pulse witdth modulation, ie, turning pin on and off rapidly, with variable duty cycle).
PWM is generated using the hardware timers' output compare function - this is available on 2 specific pins for each of the three timers on the Arduino. I think these pins are marked on the Arduino board itself, but I don't recall exactly how - I don't have any Unos. They're 3,5,6 and 9,10,11 on the Uno.
On pins that don't support it, analogWrite(pin,128 or more) is the same as digitalWrite(pin,HIGH), analogWrite(pin,127 or less) is the same as digitalWrite(pin,LOW).
There are some wonderful pinout diagrams online, and these all mark which pins support PWM. Take a look, and save whichever one you like best (I recommend printing it out on a color laser printer and getting it laminated; that's what I did for the chips/boards I use most - the sort of copy-shop places you can take stuff to be laminated can usually also do color laser printing) https://www.google.com/search?q=arduino+uno+pinout&tbm=isch