They do not do anything to actually speed the healing process, but there are two effects to be considered.
The first is that, inflammation is itself a form of damage. While ongoing, it inhibits the rate of healing. So that means your body had less to repair right in the injured spot. In this way, it sometimes allows your body to heal injuries where otherwise chronic inflammation would just go on and on.
The second is that pain is a signal that something is wrong. This can lead to secondary injuries as someone attempts to resume normal performance on a still-injured part of their body. In that case, the re-injury would prolong the healing time.
There is some evidence that NSAIDS (Non-Steroidal Anti-Inflammatory - the technical name for those drugs) has a negative effect on healing bones, and may prolong healing times for muscular injuries as well.
Until we have better data, we can say they easing the pain and inflammation while not slowing healing to a degree that causes much worry.