A xylophone produces sound when its wooden or synthetic bars are struck with mallets. Each bar is tuned to a specific pitch, and when played, it creates a distinctive sound.