Looking at the third picture I can see two arrays of plated through holes, these are usually to improve heat conduction through the PCB and probably have a surface mounted power device under them. The block would be to conduct heat from the copper area on the board to the thicker metal surface and at the same time provide electrical insulation and a degree of mechanical stability. The blocks are commonly used in equipment as a heat conductive 'filler' because their elasticity lets them flex to fit the contour of the surfaces well.
I'm not sure about the first and second pictures, it is probably the same stuff but I can't see a source of heat so maybe they are just using it for it's mechanical properties.
In that kind of equipment it certainly isn't RF absorbing foam so I doubt it is there for EMC purposes.
Brian.