The first four gravitational wave events detected by LIGO were all interpreted as merging black hole binaries ( BHBs ) , opening a new perspective on the study of such systems . Here we use our new population-synthesis code MOBSE , an upgraded version of BSE \citep Hurley2002 , to investigate the demography of merging BHBs . MOBSE includes metallicity-dependent prescriptions for mass loss of massive hot stars . It also accounts for the impact of the electron-scattering Eddington factor on mass loss . We perform > 10 ^ { 8 } simulations of isolated massive binaries , with 12 different metallicities , to study the impact of mass loss , core-collapse supernovae and common envelope on merging BHBs . Accounting for the dependence of stellar winds on the Eddington factor leads to the formation of black holes ( BHs ) with mass up to 65 M _ { \odot } at metallicity Z \sim { } 0.0002 . However , most BHs in merging BHBs have masses \lesssim { } 40 M _ { \odot } . We find merging BHBs with mass ratios in the 0.1 - 1.0 range , even if mass ratios > 0.6 are more likely . We predict that systems like GW150914 , GW170814 and GW170104 can form only from progenitors with metallicity Z \leq { } 0.006 , Z \leq { } 0.008 and Z \leq { } 0.012 , respectively . Most merging BHBs have gone through a common envelope phase , but up to \sim { } 17 per cent merging BHBs at low metallicity did not undergo any common envelope phase . We find a much higher number of mergers from metal-poor progenitors than from metal-rich ones : the number of BHB mergers per unit mass is \sim { } 10 ^ { -4 } M _ { \odot } ^ { -1 } at low metallicity ( Z = 0.0002 - 0.002 ) and drops to \sim { } 10 ^ { -7 } M _ { \odot } ^ { -1 } at high metallicity ( Z \sim { } 0.02 ) .