Explosives are just one way we can produce seismic waves in the ground. By placing geophones on the surface, which measure the rate of change of displacement of the surface, we can actually guess where there are boundaries between different rock types in the subsurface. When we detonate our chosen 'seismic wave generator' the geophones begin recording this change in displacement. As the seismic waves propagate and hit boundaries between rocks of different acoustic impedances (resistance to propagation of seismic waves) some of that wave energy will reflect back to the surface and some will be transmitted downward (http://petrowiki.org/Seismic_wave_propagation#Reflection_coefficients). The amplitude and sign (positive/negative) of those recorded wiggles tell us about how big the contrast in acoustic impedance is as well as if acoustic impedance is increasing/decreasing downwards. This allows us to produce a picture of the subsurface where the x-axis is offset of the geophones from the wave source and the y-axis is the time it takes for the wave to travel down and back up as shown in this picture:
However it is never that simple. A lot of processing has to be done to make sure our initial image is the most accurate picture of the subsurface we can make and even then there is still uncertainty. It must also be stressed that we don't actually know about the properties of the rocks themselves just that boundaries exist between these rocks. If we want to estimate that we can use processes such as seismic inversion.