Some bacteria form a slimy, viscous layer covering the cell wall. This layer is known as capsule. These capsules are beneficial to the bacteria because:
i) they attract other bacteria to form colonies.
ii) they enable bacteria to stick to the surface.
iii) capsules contain water which protects the bacteria against dessication.