Clarinets and saxophones are both woodwind instruments, but they have different lengths and shapes. Clarinets have a cylindrical bore, while saxophones have a conical bore. The length of the instrument also affects the pitch, with longer instruments producing lower pitches.
For clarinets, the written notes are transposed up a whole tone (two half steps) from the actual sounding pitch. So, when a clarinetist plays a written C, the instrument actually produces a B♭. This is because the clarinet is longer than a B♭ clarinet, so the pitch is lower.
Saxophones are also transposing instruments, but the amount of transposition varies depending on the type of saxophone. Alto saxophones are transposed down a major sixth (nine half steps) from the actual sounding pitch, tenor saxophones are transposed down a whole octave (twelve half steps), and baritone saxophones are transposed down a major ninth (thirteen half steps). This is because these saxophones are all shorter than the B♭ clarinet, so the pitches are higher.
The reason for transposing these instruments is to make them easier to play in certain keys. For example, if a clarinet were not transposed, then the clarinetist would have to play a very high register in order to play in the key of C. By transposing the notes up a whole tone, the clarinetist can play in the more comfortable middle register of the instrument.
The transposition of clarinets and saxophones also helps to balance the sound of an ensemble. When these instruments are playing with other instruments, such as violins and trumpets, the transposition helps to ensure that all the instruments are playing in the same key and that the overall sound is balanced.