Coffee grounds benefit soil the same way compost and mulch do, they add organic matter. You might as well just compost the grounds and add the compost to the soil.
It is a myth that coffee grounds acidify soils. By the time they break down they have a pH close to rain water. Here is a related question about pine needlesa related question about pine needles that has a very thorough answer debunking this myth. Here is a link specifically about coffee grounds.