I don't know if the commercial manufacturers are filtering the brews using something like a sieve filter or ???, but traditionally it is done as
a fining of the ferment in order to clarify the beer, ale, or wine; to remove the cloudy yeasts and side products like excess sulfur and copper which may be stoxic. The ferment itself is not toxic like the residues of sulfur and copper in excess, but if you get a skunky beer, it is because it hasn't been sufficiently clarified of its sulfurs and metals, perhaps by deliberate intent.
Back in the 70's, I think the technical term for trapping and reinserting the carbon dioxide during and after fining the ferment was
krausination; to krausinate the result after clarification by fining, but I can't find it on The Net and it's been so long ago, I don't even care, but I found the brewing supply site at the end of this reply just now and note that the name of the website is E.C. Krause, so I'm probably not as forgetful as I may seem to myself!
When the carbonated brews or sparkling wines are clarified or filtered, the finings release the gas by reaction, so it is usually not a matter of artificial carbonation from an external source of carbon dioxide. Usually the brewer or wine master catches the gas released during the fining process and reinserts the same gas back into the ferment under pressure after clarification, however, the gas may be filtered by carbon/charcoal before reinsertion.
A traditional champagne is not clarified, which is why there is a fine sediment at the bottle of a classic champagne. Often when the ferment produces a stable sediment that stays on the bottom of the bottle without kicking up like a dust cloud when poured, then as a traditional drink it may not be clarified. Clarification is usually practiced for ferments that produce a cloudy solute or a toxic side product which may cause hangovers, distress, to remove it.
As a side note, fining is done to remove excess sulfur, but bi-sulfites (Campden Tablets, bi-sulfite powders) are typically added to ferments in order to kill the yeasts; to stop fermentation once the approximate desired level of alcohol from the yeast fermentation is reached. Using sulfurs to control alcohol production is the commercial quick and dirty method for controlling strength.
http://en.wikipedia.org/wiki/Finings
http://www.eckraus.com/campden-tablets-100.html