It is confusing to many people that euphonium (or "baritone") music is written both in B-flat and in C. The instrument itself it built in the key of B-flat. The lowest natural note that can be played with no valves is a B-flat. The same is true of trumpet, for example. Trumpet music is transposed so that the open fundamental is written as a C. In other words, the music is transposed up one full step. A true B-flat is written as a C, and the key is changed accordingly, adding 2 sharps or subtracting 2 flats.
A trombone's fundamental is also a B-flat. However, for trombone the music remains in concert pitch and is usually in bass clef. So when a trombonist plays a written B-flat, it will come out as a B-flat in the correct octave. The trombone is made in B-flat but players are taught to read the music so they will be playing concert pitch.
A euphonium is in the same key as a trombone and in the same octave. Euphonium music can be written in bass clef, and in that case it will sound in concert pitch in the correct octave. But the player will produce a concert B-flat when playing an open note.
The other way of writing euphonium music is in transposed treble clef. The only difference is the way the music is printed, not in the horn itself. It is transposed so that the open note is a C, but in this case it is also moved by an octave to avoid too many ledger lines. So a B-flat below middle C on the piano (just below the first ledger below the treble clef staff) is written as a 3rd-space C in treble clef. Euphonium music in treble clef is written in the same octave and transposition as bass clarinet and tenor saxophone music.
Euphonium music written this way might have come about for one or both of the following reasons: 1) some euphonium players (me included) started as trumpet players and were switched to euphonium. Treble clef music made the switch easy because all the fingerings are the same as trumpet. 2) Euphonium is part of the brass band tradition, where all the instruments except bass trombone are written in transposed treble clef. So in brass band music, a player can play with the same fingerings on E-flat cornet, B-flat cornet, E-flat alto, baritone horn, euphonium, EE-flat tuba, or BB-flat tuba.
Trumpet players usually learn to read from a piano score, where they will mentally transpose up a full step. While doing this they are playing in C on a B-flat instrument. Trumpet music could just as easily be written this way (in concert pitch). If it were, trumpets would still be in built B-flat, even though they play in C.