Does helmet padding contribute to the safety of a helmet? Does the padding inside of a bicycle helmet contribute to the overall security of the helmet? I.e. do they cushion a crash in some way, or are they just there for comfort?
Because there is an optimum placement position for the helmet on the head, having padding that helps keep the helmet in place, or makes the helmet more comfortable to wear, indirectly contributes to the safety of the helmet.  But aside from a very minor absorption of force during the moment of impact the padding really has no direct impact on the safety a helmet.

Modern bike helmets are designed to deform in a crash.  Basically, the hard foam and plastic that the helmet is made out of, crumples during an impact.  This dissipates the force of impact during a crash. For this reason it is important to replace your helmet after any significant impact.  The padding is mostly there for comfort, and to make the helmet fit slightly better.  

From the Bicycle Helmet Safety Institute
"The spongy foam pads inside a helmet are for comfort and fit, not for impact protection"