Light and sound waves behave differently because they belong to different types of waves: electromagnetic waves and mechanical waves, respectively.
Light, or electromagnetic radiation, consists of photons, which are particles that can also exhibit wave-like behavior. Electromagnetic waves do not require a medium to propagate and can travel through a vacuum. They can travel through empty space because they are composed of oscillating electric and magnetic fields that can self-propagate.
On the other hand, sound waves are mechanical waves that require a medium to travel through. They are produced by the vibration of particles in a substance, such as air, water, or solids. Sound waves travel by causing successive compressions and rarefactions of the medium. In a vacuum, there are no particles to vibrate, so sound waves have no medium to propagate through and cannot travel.
In summary, light, as an electromagnetic wave, can travel through a vacuum because it does not require a medium, whereas sound, being a mechanical wave, requires a medium and cannot travel through a vacuum.