On motorbikes my take on it is that compressing the bubbles makes them smaller and more able to move through the orifices and lines - they can then migrate to the highest point, hopefully the master cylinder. Of course with the brake lever pulled the fluid port in the cylinder is closed but when you release the lever the air should then exit the cylinder into the reservoir. Of course this requires there to be a reservoir and fluid port - I'm not sure many or any bicycle brakes have a reservoir, other than the master cylinder itself, so the above method won't work on its own, but may then allow you to expel any air at the cylinder bleed/fill port.