There are different behaviours... For Penetration usually tail fuzes are used, preventing them to be damaged while penetrating. But, also, you can configure one for instant detonation and the second for delay detonation. Pilot chooses the type of target, and select which to use. Or use both to ensure explosion.
Example. Dropping a bomb in a hangar.... better to delay the explosion till the bomb goes through the roof. Same in jungles.
Things like that. I don't think is modelled in dcs.