The influence of plasma density and edge gradients on the development of perpendicular sheared flow has been investigated in the plasma edge region of the TJ-II stellarator. The development of the naturally occurring velocity shear layer requires a minimum plasma density. Experimental findings have shown that there is a coupling between the onset of sheared flow development and an increase in the level of plasma edge turbulence; once sheared flow is fully developed the level of fluctuations and turbulent transport slightly decreases whereas edge gradients and plasma density increases. Electron density profiles show a broadening evolution as density increases above the critical value where sheared flow is developed, while the temperature profile remains similar, reflecting the strong impact of plasma density in the global confinement scaling. Furthermore, the shearing rate of the spontaneous sheared flow turns out to be close to the one needed to trigger a transition to improved confinement regimes. Density ramp experiments show, within the experimental uncertainty, no evidence of hysteresis during the spontaneous shear development. Power modulation, in the proximity of the critical plasma density, allows the characterization of plasma potential and electric field relaxation during the transition. The present results have a direct impact on the understanding of the physics mechanisms underlying the generation of critical sheared flow, pointing to the important role of turbulent driven flow.