By the time a beer has completely fermented out it has consumed most of the oxygen, which is a good thing, as oxygen at this stage is a staling agent and will reduce the shelf life of the beer. However, in transferring the beer inevitably a little O2 is reintroduced, bad thing, but. By leaving a gap there are two benefits, the first is that the yeast has a little O2 to work with (removing in the process i.e. good thing) to produce the CO2 and the gap gives it the space to expand into, eventually being reabsorbed into the beer during the couple of weeks in cold storage. No gap this doesn't happen = flatter beer.
The other question was about CFC bottled beers. Here the beer has already absorbed the CO2 by either secondary conditioning or force carbonation. Theoretically a gap is not a good thing as the CO2 will come out of solution to fill it, leading to flatter beer.