system
Given the following post, respond as if you're commenting on Reddit:
human
Why do biofilms form? What is the mechanism bacterium use to communicate with each other in such a situation?

I thought prokaryotes were just a nucleoid and some ribosomes contained in a cell wall. When they form a biofilm, what the heck is going on?

After taking courses in biology, I came across this strange phenomenon. I've got a rudimentary understanding of cell biology, but I'm still confused as to how such simple structures as prokaryotes can perform hive mind actions like forming a biofilm.
gpt
Quorum sensing would be the correct term here.  A bacterium can detect the presence of other nearby bacteria because they secrete a ligand. This chemical signal is receive by the sorounding bacteria, and depending on the concentration of this signal, different actions are taking. 

This type of activity is also exhibited when bacteria form single layer formations. Let me know if you need a more detailed explanation of how bacteria communicate chemically.