In magnetic confinement devices, boundary turbulence is responsible for transporting plasma and energy from the well-confined region towards the material surfaces where it can severely harm reactor relevant machines. It is therefore essential to develop a solid understanding of the mechanisms behind the transport in the edge of the plasma. Large fluctuations, often called filaments, dominate the particle transport in the edge and determine the erosion of the plasma facing components in steady state conditions. A statistical framework that relates the fundamental physics of Scrape-Off Layer (SOL) L-mode and inter-ELM filaments with the profiles they generate is presented. This work will discuss the theoretical and numerical work aimed at understanding statistics and dynamics of plasma filaments, which represent the basis for the statistical framework. The framework predicts that radially accelerating filaments, less efficient parallel exhaust (e.g. due to interaction with neutrals) and a statistical distribution of the radial velocities can contribute to induce flatter profiles in the far SOL and therefore enhance plasma-wall interactions. Also, profile broadening at high fuelling rates, potentially harmful for ITER, can be caused by interactions with neutrals in the divertor or at the wall or by a significant radial acceleration of the filaments. The mechanisms governing the interaction of pairs of filaments, as well as the dynamics of high beta, inter-ELM like, filaments were investigated and employed to improve the statistical framework. The results of the framework are backed up by experimental comparison with measurements taken on JET and MAST. Advanced machine learning algorithms were developed and deployed, including convolutional neural networks applied to filament identification in images, techniques that have an interest that goes beyond the validation of the statistical framework. In all cases treated, the theoretical prediction matched the experimental data within errorbars. Work supported by RCUK [grant number EP/I501045] and Euratom.