Infection in your body causes release of certain chemicals like Tumor Necrosis Factor (TNF) which signal the body to defend against this infection. It is specially so when you are infected by gram negative type of bacteria. If you are healthy, your body blocks extra TNF but if you are suffering from certain diseases like Rheumatoid arthritis, too much TNF is produced leading to inflammation & pain.