when direct mounting pickups (screwing the directly to the wood) the pickup will interact with the body wood more than when they have a mounting rings and springs seperating them. The foam can reduce this and also helps with height adjustment of a direct mounted pickup
some people like the sound difference with direct mounting, some people dont.
if its a microphonic pickup then some foam behind can stop any excess vibration in the pickup which can sometimes help to reduce the squeal caused by the pickup sensing its own loose parts or coil wire moving around... not really an issue with BKP's