There is a charge controller chip inside the phone that determines how much current to put into the battery. Generally lithium ion batteries are charged with a constant current until the cell voltage reaches a specific level, at which point the charge controller switches over to constant voltage charging until the current drawn by the cell decreases to zero. It's a bit difficult to think about in terms of resistances as the cell itself has chemical reactions going on inside and the charge controller is built up with many transistors.
One thing to note about ratings: the rating on the power supply is generally the nominal voltage and maximum current. It does not supply the current on the label at all times. It's quite easy to see why this is: when nothing is connected, there is no path for the current to flow so the current is zero.
Charge controllers generally regulate the flow of current into the cell in one of two ways. Depending on the design of the charge controller, the controller IC can use a transistor to act either as a switch or as a variable resistance. Linear charge controllers work like super fancy variable resistors, changing the resistance between the charger input and the battery terminal so that a specific amount of current flows. The current is usually measured with a current sense resistor, a resistor with small value (generally 0.01 to 0.5 ohms) that generates a small voltage in proportion to the current. The measured current is then used in an analog feedback loop to control the transistor. This drive transistor dissipates the difference in voltage between the charger input and the cell as heat, P = (Vcharger-Vcell) * Icell. Linear charge controllers are generally small and cheap, but inefficient. This dissipated power can result in quite a bit of extra heat that has to be dissipated somewhere. Linear charge controllers also must have a higher input voltage than the desired cell charge voltage. Lithium ion batteries generally charge to around 4.2 volts per cell, so a single cell with a 5v power supply leaves the charge controller around 800 mV to work with.
Another design of charge controller is a switching controller. These controllers use a DC to DC converter to move charge into the cell. A DC to DC converter uses two switches (generally a transistor and a diode) and some form of energy storage (generally an inductor and several capacitors) to efficiently change the input voltage. A step-down conveter (also known as a buck converter) works by alternately storing up and draining energy in the inductor at a high frequency (100s of kHz to a few MHz). Since the transistors are either fully on or fully off most of the time, less power is dissipated making the converter more efficient. It is also possible to design a converter that can draw power from a supply with lower voltage than the cell voltage. Aside from the DC to DC converter, the operation of a switching charge controller is essentially the same as a linear charge controller: it measures the cell current and voltage and generates a control signal to adjust the duty cycle of the switching transistor to change the current flowing into the battery. Switching charge controllers are more complex and more expensive, but more efficient than linear charge controllers.
Now, as for how much current the charge controller can draw to charge the battery, this is generally determined by the software running on the phone. When you connect the phone to your computer's USB port, it can only draw a limited amount of power before it has to ask the computer for permission to draw more. Cell phone chargers generally advertise their current limit via a resistor connected between the USB data lines. This resistor is detected and measured and the corresponding current limit is then passed along to the charge controller so it knows how much current it can safely draw to charge the battery.
As far as sharing power with the battery charger, the phone will certainly draw additional power above and beyond what goes in to the battery. In fact, depending on how the phone is configured, it can draw more power when plugged in to a charger than it would if it was running off of its internal battery, using this current to provide a brighter display, longer backlight on time before standby, higher CPU performance, etc.
Best Answer
All newer phones use Lithium polymer batteries.
Why is it Partially Charged?
To decrease their aging they are intended to be stored at 40% charge. This means when you receive your phone it should be at 40% charge, otherwise they will have aged your battery for you. (you are probably used to the effects of aging, like a 2 year old phone seeming to have very short battery life). When you get your phone you can use it until it is discharged, but they normally say 'charge it' because people will not notice the partial charge.
Do Not Fully Discharge
You should not fully worry about fully discharging, this is superstition to earlier battery technologies. Fully discharging a lithium battery is one of the best ways to make it fail. below a certain charge they will have their overcharge protection circuitry fail and you cannot charge it at all. I have seen studies that show that this makes up more than 75% of "failed" lithium batteries.
Lithium Battery Aging
Lithium batteries have a set number of charge discharge cycles before they fail. This might be a number like 500 cycles. You actually get more like 1000 cycles if you only discharge to 50% before recharge. Lithiums really do not like a deep discharge, I cannot stress this enough.
If you would like more information about lithium battery technology let me know, I can get you many links, just drop me a comment. I have a few answers on the electronics and robotics stack exchange about it.
Can I leave it plugged in all the time?
Yes, and no. This is very dependent on whom makes your device.For example, my Lenovo laptop will not apply a charge to the battery unless it is under 97%. When it does charge the battery it charges directly to 100%, then stops until the battery sags below 97%. Many laptops did not do this, on most just applying charge if it is not 100%. This would put the battery through thousands of charge cycles in a week when you are not using the battery. This ages a battery quickly.
If your phone maker took the time and paid the extra cash then your phone will stop charging once it reaches full charge and just power the system from the wall outlet. It is significantly more likely that your phone is charging your battery on a short cycle and aging it thoroughly.
Myths
Some people have some confusion from some of the myths that go about. The primary one is memory. As Battery University will say, this is mostly extinct, and actually applies to nickel-cadmium batteries. As was stated in a comment about crystals Battery university has in reference to nickel-cadmium:
Now, talking about Lithium batteries, which your phone uses, there is even more difference. To quote them battery university directly from their simple guidelines:
I understand how this may go against what you have been taught, but I am someone who not only has research this but uses lithium batteries in my day to day work as an engineer.