We describe the results of a numerical investigation of the dynamics of breakup of streams of immiscible fluids in the confined geometry of a microfluidic T-junction. We identify three distinct regimes of formation of droplets: squeezing, dripping and jetting, providing a unifying picture of emulsification processes typical for microfluidic systems. The squeezing mechanism of breakup is particular to microfluidic systems, since the physical confinement of the fluids has pronounced effects on the interfacial dynamics. In this regime, the breakup process is driven chiefly by the buildup of pressure upstream of an emerging droplet and both the dynamics of breakup and the scaling of the sizes of droplets are influenced only very weakly by the value of the capillary number. The dripping regime, while apparently homologous to the unbounded case, is also significantly influenced by the constrained geometry; these effects modify the scaling law for the size of the droplets derived from the balance of interfacial and viscous stresses. Finally, the jetting regime sets in only at very high flow rates, or with low interfacial tension, i.e. higher values of the capillary number, similar to the unbounded case.