When we light a solid lump of explosive it burns slowly layer by layer, but when we light up powder form of explosive it just burns with a huge explosion and sound why does it happen. And one more question, what fraction of the energy in a blast is lost just in the form of sound?
It is all about the surface area. On a block of M112 composition C4 explosive, the total surface area is merely 70 inches. However, in a fine grain powder (any flammable powder whether explosive or not, I'll explain in a second.) there could be hundreds of thousands or millions of tiny particles, each with their surface exposed to the flame. The greater the surface area present, the faster the flame ignites. This can be seen in explosions in factories that produce fine particles that are flammable. As the fire spreads out 360 degrees in 3-dimensional space (basically that means it expands as a sphere not a 2-D circle) it can increase in speed. Each particle burns through its fuel supply (the fuel supply being the particulate itself) far more rapidly than a chunk because, as Martin Beckett said, in order to burn through the fuel source as a chunk, it must first burn through the outer layers.
Now, to answer your question more thoroughly, you need to understand a few things. First, in order to create an explosion, you need heat and pressure. The heat will cause pressure to build up; basically, this means that as the material is converted into gas. The rate at which that material converts to gas is what dictates whether you have an explosion (as in high explosives) or you have deflagration, a technical term basically meaning that it burns. Technically, whether the material explodes or deflagrates the process can be understood as a cloud of expanding gas, which is a result of a solid or liquid material being converted to gas. If that rate of expansion exceeds the speed of sound, you will have an explosion. In fact, the "boom" that is produced from the explosion is simply the expansion of that gas passing the sound barrier; it's the sonic boom of the gas. If that expansion does not surpass the speed of sound, it merely deflagrates. Those are the distinctions between high (rate of expansion exceeds the speed of sound) and low (rate of expansion does NOT exceed the speed of sound).
Lastly, I am not sure that there is energy lost to sound, the sound is merely a by-product of the speed. At least, not that I have heard. I may be all over the place here, but I am usually explaining this to people with a rather firm grasp on explosive theory, and have not taught neophytes in years. There is a lot more to it than this and the specifics of the powder and solid explosives matter a great deal as well. I'll clear anything up if needed.
Gunpowder is a low speed explosive (by strict modern standards it isn't really explosive)
A burning explosive isn't the same as detonating. The combustion (burning) is spread from one part of the explosive to the next by the flame on the surface. In a large piece of explosive the burning can only reach the center slowly as the explosive burns away. In a finely powdered explosive there is a lot of surface area for the flame to reach quickly.
In a detonating explosive the detonation is set off by a supersonic shockwave so the entire explosive reacts 'almost' instantly