Experimental data from many Tokamaks suggest that an important fraction of radial particle and heat transport in the Scrape-Off-Layer is due to poloidally-localized propagating structures of increased plasma density (blobs). A better understanding of the mechanism leading to blobs might help to lower the radial transport and control damages to plasma facing components. Such structures are experimentally investigated in the basic toroidal device TORPEX. Ion saturation current measurements from a two-dimensional imaging probe are analyzed using conditional sampling (CS). This technique is extensively studied and a large variety of trigger conditions is used to detect coherent structures in the turbulent plasma. Two scenarios are observed which lead to the ejection of blobs. The role of the density gradient in the blob ejection mechanism is investigated. In a first step, the evolution of the gradients leading to blobs is studied by triggering on such events. Their magnitude increases with the size of the blob. In a second step, these gradients are used directly as reference signals for CS. Strong gradients are found to have an enhanced probability to give rise to a blob. The location of the source before a possible blob ejection is also determined. It is concluded that the effect of the source is to steepen up the gradient in a uniform way along the vertical direction.