Why is mains power sometimes 110V and other times 120V?
In the US, the electric utilities are supposed to deliver power to residential customers at anywhere between 110 and 125 VAC RMS. The value 117 (or 117.5 or 118) is often seen on products, because that is the middle of the specified range.
If you're developing a product for general sale, it would be prudent to add a testing margin that's at least 5% or even 10% beyond the nominal range — perhaps 100 to 140 VAC RMS.
Adding to the answers here as to why the power company does play with the voltage: They will do their best to maintain your countries' accepted hertz value, normally at 50 or 60 cycles. They will sacrifice (brownout) voltage to insure the most important variable for equipment, hertz. Any change will make motors spin faster or slower, meaning timers and the like will not function properly. A voltage drop may be from 'imperfect conditions' but hertz variation is absolutely unacceptable.
Addressing just the reason why voltage varies, you are correct in thinking line losses play a role. No normal wire is a perfect conductor. Superconductors come very close, but for those of us working with normal electrical components, wires are just small valued resistors. As such, they experience a voltage drop when current flows through them, by Ohm's law. This is also why long-distance power transmission is done at high voltage, and stepped down as near to the customer as pratical.
You can observe this directly when a motor in your fridge, air conditioner, or clothes dryer turns on: the high starting current of the motor pulls the voltage in your house down, dimming any incandescent lights. Of course the running current is much less, so the lights appear to return to their original brightness, but if you were to measure carefully you would find they are a tad dimmer than they are without the motor running. With a large AC compressor even the current after starting is significant enough to dim the lights until it switches off.
Of course the electric utility attempts to mitigate this effect, but nothing is perfect.