If your home's main sewer line is connected to a septic system, an independent waste disposal system not part of your city or county's sewage system, coffee grounds are bad for the septic system and can eventually clog it. Also, increasing the amount of solids in your septic tank decreases its holding capacity and requires the tank to be pumped more frequently.
It's safe to place coffee grounds in your garbage disposal if your home's sewer line is connected to a city or county sewage system. The sewer system will filter out the grounds without any issues. Coffee grounds are not like fatty food debris and grease, which can clog the device and sewer pipelines.
When placing coffee grinds in the garbage disposal, turn on your sink's cold water faucet and let it run, and then place the grounds slowly down the sink. Let the water run for at least one minute after the grinding process is complete. The cold water will flush the grounds through the disposal and out of your sink as well as any food debris that may be sitting in the disposal.
Never run hot water through your disposal; it melts fatty foods and debris resulting in the debris clogging the disposal and sewer pipes. Also, don't place any coffee filters in the disposal or any other paper products. Garbage disposals are designed for soft food and food debris --- not papers, diapers, and other household items and waste.