Probably not true for every phone but in general:
Charger gives you 5V 1-2A over usb
Charging circuit in phone reads battery decides how much current to pull
Charging circuit feeds the battery at around 4V because Li-Ion is fully charged around 4ish volts.
This brings us to relevant bit number one. The phone doesn't run on 5V 1-2A directly, it runs on the battery, which is less than 5V. To run directly on the 5V input the manufacturer would have needed to plan ahead, which costs money, so most don't.
The second point is if you yank out the battery in most phones the charging circuit isn't even connected to the main power, it just runs through the battery typically, so you can't even feed charge to the device without running it through the battery.
Third point is retarded charging circuit might say "hey no battery no phone" regardless of if it can run or not.
So the answer is it depends. It possible to run right off the charger, but it's cheaper and easier to pass through the battery. A few phones will run with the battery pulled out. Some will run if you take a 4-pin adapter and stick where the battery is supposed to be to connect charge circuit and main power. Some phones probably do this already by having a bypass inside the battery itself, but to be honest manufacturers seem to prefer that your battery die earlier.
Maybe the most salient point is that Li-Ion don't like being plugged in all day. Li-Ion batteries are happiest when hovering around 40% charge, in general they suffer the least degradation if they are used from around 30-80%. If longevity is your concern the primary ways to keep your battery are 1) never go below 20%, 2) limit the amount of time spent near full charge, 3) always use the slowest wired charger you have. Basically trickle charging throughout the day. [Here's](https://imgur.com/a/wHg8Q
) my Axon 7 after about 1.5 years. 50 hours on battery with light use, still another 25 hours left. I get up to 5 days sometimes.
Should be the power adapter, but may, in some case, use a bit of the battery.
A common power circuit is a T. power on the left, battery on the right, load at the bottom. It should in theory take the power from the side with the highest voltage. 5V supply, 3-4.4V battery.
The real path is more: adapter -> current sense resistor -> diode -> output <- diode <- current sense resistor <- battery.
Bridging the two ends of the current sense resistors, sitting across the output, sit the charging circuit.
The diode prevent a direct battery to input and input to battery current path, but allow both to power the load. Take note that it is usually also in parallel with a mosfet, and some circuit to turn on and off the mosfet (the diode first conduct, but lose some voltage. The circuit detect it and turn on the mosfet, which short the diode and basically no voltage is lost, making a 'perfect diode').
The charger then can see the battery voltage and current, and the amount of power used at the input, and control the charge as to not overcharge and not overload the adapter...