You ever wonder why the small band of spectrum we can see (called visible light) is special? I mean almost all animals see in light ranges are are somewhere around here. I mean sure some can see a little farther into IR or UV but in general all animals see roughly around this same narrow band of frequencies in an otherwise infinite spectrum... So what is so special?
Its actually a quantum thing. Everything roughly around visible light and higher interacts with material by electrons jumping energy levels. However IR energy is absorbed by the bonds between molecules instead, which is why IR represents heat.
Basically visible light is right where these two modes intersect. Essentially they are the lowest energy part of the spectrum that is still high enough energy to interact primarily through changing energy levels of electrons. Essentially any more energy and it wont really get through the atmosphere as extreme UV is cut off.. any lower and it wouldnt be very effecieient cause most of the energy goes to heating the eye rather than seeing... So its right in that sweet spot.
While you are right, believe it or not your talking about the same thing.
If you look at black body curves of different temperatures, which is rougly what our sun is, then the peak of the light emission at almost any temperature roughly fovers around the same place.
In fact the peak of a blackbody radiation is asymptotic... mean while it does shift the hotter it gets the less it shift.. it approaches a fix point at higher temperatures. See the attached chart for an example of this, notice the verticle line defining the peake of the blackbody curve approaches a vertical line near the higher temperatures.
This asymptopic response is due to the exact same effect im describing. That is the line represents about the point where the mode of quantum interaction is inter-bond vs free electrons. For this reason you are likely to have any star with its peak in roughly the same range.
Likewise the absorption spectrum of our sky lets the peak light of the sun through because again where these two modes interact is "special" and this a lot of gases are more transparent around this region..
In fact I didnt want to go into this but solid materials are more often transparent around visible like than other parts of the spectrum slightly above and glow it (until you get too far away)... its favorability to transparency is also important so it gets through our atmosphere.
So basically while your right these effects of peak of the sun, transmission throught he atmosphere are all important yes, they ultimately all go back to being results of this same principle.