When a xylophone bar is struck, it vibrates at its natural frequency. This frequency is determined by the bar's length, thickness, and material. The longer the bar, the lower the frequency, and the lower the pitch of the sound. The thicker the bar, the higher the frequency, and the higher the pitch of the sound.
The bars on a xylophone are arranged in order of pitch, with the longest bars at the bottom and the shortest bars at the top. This allows the musician to play melodies and harmonies by striking different bars.