Sound waves and light waves have different properties that affect their ability to pass through walls.
Sound waves are mechanical waves that require a medium, such as air, water, or solids, to propagate. They travel by causing particles in the medium to vibrate, transferring energy from one particle to another. When sound waves encounter a wall, the wall acts as a barrier and absorbs or reflects the energy of the sound waves. The molecules in the wall are closely packed, making it difficult for sound waves to pass through. The energy of the sound waves is primarily absorbed by the wall, causing it to vibrate, and very little sound energy is transmitted to the other side.
On the other hand, light waves are electromagnetic waves and can propagate through a vacuum as well as through transparent mediums such as air, water, and glass. Light waves consist of oscillating electric and magnetic fields that can travel through space. When light encounters a wall, its behavior depends on the nature of the material that makes up the wall. Transparent materials, like glass, allow light waves to pass through because their molecular structure does not interfere significantly with the oscillating electric and magnetic fields of the light waves. However, opaque materials, like most walls, are composed of densely packed atoms or molecules that can absorb and scatter light. The atoms or molecules in the wall interact with the incoming light waves, absorbing their energy and re-emitting it in various directions, which gives rise to the phenomenon of reflection.
In summary, sound waves require a medium to propagate and interact with the particles of the medium, making it difficult for them to pass through walls. On the other hand, light waves are electromagnetic waves that can travel through a vacuum and certain transparent materials, but when they encounter opaque materials like walls, they are absorbed and scattered due to interactions with the atoms or molecules in the material.