Coffee grounds contain around 2% nitrogen as well as varying amounts of phosphorus and potassium which are all very important for the growth of tomato plants. By mixing some coffee grounds into the soil below your tomato plants you're introducing these nutrients that the plants need to thrive.