The lecture will elucidate the biological and physical forces controlling the formation of biofilms, bacterial communities encased in a self-secreted polymeric matrix. In particular, we will present several biophysics studies illustrating how biofilm microstructure is affected by environmental forces and, in turn, affects its macroscopic properties and protective properties. The lecture will consistently underscore the application of soft-matter tools and analytical frameworks in biofilm investigations. Moreover, it will demonstrate the importance of recognizing the analogy between biofilms and colloidal/polymer gels, as it proves essential for controlling and engineering this ubiquitous bacterial lifestyle.