There’s certainly some historical stuff going on; some instruments are transposing more out of tradition than need. For example, the horn (or French horn if you prefer) is a transposing instrument because, before the invention of valves, horns would have to be modified to be in many different keys. A horn in C could only play the notes of the C overtone series (more or less), and so wouldn’t be too useful for a piece in the key of Eb. Horn player had many different lengths of tubing (called crooks) which they could remove or insert or substitute to change the key of the instrument to fit the composition. However, they didn’t want to have to learn entirely different fingerings for all of those different keys, so the notation just pretended that the instrument was always in C. When the horn was a C horn, C was a C. When the horn was an Eb horn, C was an Eb. When the horn was an F horn, C was an F. The same fingering was always used for “C”, the tubes would just alter “C” to be whatever pitch was necessary. [see note below]
The modern horn is always in F, so theoretically we could change the notation system, but F tuning is what all of them know and are used to. However, some instruments still do get used in multiple keys. All of the different saxophones are different transpositions and have different ranges, but thanks to the magic of transposition, the notation always lines up with fingerings in the same way. Same deal for all of the clarinets and all of the trumpets. A particular notation always indicates the same fingering, even though the pitches that come out vary substantially. The burden is on the notater to figure out the proper written notes to get the sound they want, rather than the performer. This makes sense, because the notater generally has all the time in the world, while the performer is also trying to play correct rhythms, proper dynamics, expression, etc.
[As Phoog points out in the comments, my wording here is false because natural (i.e. valveless) horns don’t have fingerings, that’s the whole point. I’m having trouble thinking of a better way of saying it, especially one that maintains parallelism with the second paragraph, in which “fingerings” is the right word. On a natural horn, pitch is controlled by the embouchure and the airspeed among other less tangible techniques, but the central point is the same: on some level, seeing a “C” means the same performance parameters regardless of the sounding pitch. ]