Nucleoid-associated proteins (NAPs) are used to organise bacterial DNA in a similar fashion to histone proteins in eukaryotes. NAPs fold and bend the DNA to pack it more tightly in the nucleoid. Without NAPs it would not be possible to fit bacterial genomes in the small cells.
NAPs can be used to control gene expression, more tightly packing the regions of DNA that the cell wants to transcribe less frequently or silence. This is a similar process to DNA methylation in eukaryotes, suppressing transcription on the targeted region.