One thing that is very confusing to me right now is the difference between bottling and kegging, more specifically the carbonation difference between them. The first doubt of kegging arises when you would extract the beer inside of it. You could use a party pump or a co2 cylinder system. But if you used a party pump wouldn't the beer be flat? Like you add sugar when priming to generate co2 and etc. I understand that this is emulated by the co2 cylinder when kegging. But if it is already carbonated why would you use co2? Is the beer inside of a keg really 'flat'? I think to better address the question would be important to explain in what stage (primary, secondary fermentation, .. ) the beer in commercial kegs are. Thanks!
Let's separate this out into two phases: carbonation and dispensing.
Carbonation inside a keg can be done just like carbonation inside a bottle: by the addition of a specific amount of sugar, which will be fermented by the residual yeast, which will create a specific amount of CO₂, measured in "volumes". With external CO₂, however, you can also "force carbonate", by taking advantage of
PV=nRT: a specific pressure of CO₂ at a given temperature will result in a given amount of CO₂ dissolved in the beer.
Once carbonated, you can remove that external pressure, and the beer will stay carbonated (assuming it stays or returns to the same temperature). It's in equilibrium.
Now on to dispensing. The beer in the keg is still under pressure: the volumes of CO₂ dissolved into the beer itself are in balance with gaseous CO₂ in the headspace of the keg. So without doing anything else, you can hook up a tap and carbonated beer will flow out … for a while. Once you've reduced the volume of beer in the keg, the physical size of the headspace will increase, you will have the same amount of CO₂ but in a much larger volume (of headspace), so the pressure will drop. Which will make it increasingly harder to push beer out of the keg. As well, some of the CO₂ will come out of the beer, reducing its carbonation. Eventually, it will go flat.
How to resolve this? Add more pressure to the keg to keep the dissolved carbonation intact and the headspace pressure high enough to flow.
You now have two options: a party pump or more CO₂. The only difference, really, is that a party pump will add air (~20% O₂) to the headspace, which will lead to eventual oxidation of the beer. CO₂ obviously won't.
The beer inside a keg should (and virtually always will) be fully fermented and carbonated if you're dispensing it. This is how beer in a commercial keg comes. In the situation I think you're referring to, CO2 or a pump is simply used to add/maintain enough pressure within the keg to push the beer out and into a glass. CO2, when applied at the right pressure, also maintains the carbonation level of the beer. When using a pump though (which pressurizes the keg with ambient air) the beer inside will fairly quickly lose its carbonation as the gas (CO2) in the beer equalizes with the introduced air (mostly nitrogen and oxygen) in the head space. Oxygen is also extremely detrimental to almost every desirable beer quality. So pumps should only be used when you know you'll consume the keg very quickly (maybe a couple days if it's kept cold).