Nitrogen-fixing bacteria play a crucial role in soil by converting atmospheric nitrogen into a form that plants can use, such as ammonium. This process, known as nitrogen fixation, is essential for the growth and development of plants, as nitrogen is a key nutrient required for their survival. By making nitrogen available to plants, these bacteria help improve soil fertility and overall ecosystem productivity.