The act of performing music from "sight"(reading sheet music and translating it in to sound) is a mechanical process. It is exactly analogous to "reading outloud"(which could mean reading outloud in your own mind = reading to ones subconscious).
The act works by looking at the scribbles on a page and translating them in to physical movements(kinematics which are represented by 3D space curves and why some part of practice/technique deals with the relative positions and motions of the body parts, mainly arms, hands, and fingers).
What one does when learning to sight read, more or less, is learn to place ones fingers where the notes tell them. One literally translates(maps) the specific note structure in to that of the instrument which we will take as the piano for arguments sake. One must do this "in time"(since the medium is time based, unlike, say, painting in which the performance is not time dependent) and music is clearly a function of time which musicians call rhythm/meter. (meter is the clock, rhythm is the expression of that clock in to interesting patterns)
If one see's some notes they must know how those notes translate in to their fingers. E.g., one first learns how the staff encodes notes and learns little "tricks" such as FACE and "EGBDF" but what one really is doing is learning what notes on the staff correspond to what notes on the piano.
Over time of doing this one develops/encodes a translation function that matches the written pitch to the finger pitch. Of course there is more to it since the mapping involves specific fingers(which one must learn to use any) along with physical motions and all that. Most of these things come naturally with (enough) practice and is no different than learning to solve a rubiks cube or, in some ways, a differential equation. It is "wrote" technique and is very complex but each piece is very simple(of course it must be or we would never be able to do it).
The idea though is that one is reading instructions and performing those instructions... much like a computer reads a program from memory(bits of 0's and 1's) and "performs" the program(translates those 0's and 1's in to on/off states of transistors which ultimately do things).
In "performing" it is nearly mechanical but there is some room for creativity such as varying certain unwritten things. that is, while the brunt of "fixed" music(pre-composed) is fixed there are some variables/variations: interpreting exactly what one means by: dynamics(what is forte really translate to in the muscular attacks on the keys), articulations(a trill is not a trill, or rather there is some room for variation/interpretation), rubato(playing with time in a purposeful way), etc.
But the idea is that most of the performance is mechanical and the choices for "musicality" are very limited. This is good and bad. 1. It lets everyone play almost the same thing(it's written down after all) 2. there is very little room for modifying the piece which allows one to focus on those modifications. Usually highly skilled performers will have very well developed understandings of those variables because, well, that is all they get to "mess with". A little is a lot. E.g., once you have memorized a piece to perform you have the notes down in "musicle(tm) memory" and so what you can vary are those limited things which will have your full attention.
Note that in such a thing one does not need to actually understand "music". It is simply a process of translating what is written to kinematics. There is no musicality needed to perform a piece of music perfectly. Robots have been created to do it. Computers can do it without the kinematics(e.g., midi to sound), etc. You can tell how non-musical it is by the blandness of these performances since, at least in the past, the "variables" for shaping music were generally flat(e.g., no dynamics or arbitrary dynamics, articulations played exactly the same way every time, etc).
To give an outline of how a sight reader thinks(at least from me, as I have no idea how other sight readers think, I'll also leave out a lot of details):
One looks at the music, notes the key signature to know how to interpret accidents and such. For me this is just the basic scale I'm using. The time signature tells me the meter and the tempo. Look at the music to see the general character such as the typical patterns used(block chords, arpeggios, etc). Most good music has underlying patterns that helps make a piece easier to perform because, say, it's just a repetition of something over an over(think of a fugue in which the melody(subject) is generally usually something like 90% of the piece). Obviously the more one can figure out those things the easier it will be.
Then as one starts to play one has to translate the notes to the fingers. I see a dot on the F I know I play an F(assuming the key signature doesn't have an F# in it but I've already established the scale I'm working from so I know). This is because I've done it a million times. Of course I need to know the rhythm so I look at the flag or group.
There are other complexities because it's just just banking notes out one at a time. For example, unless this is pre-rehersed, the fingering is very important. That F note requires the right finger to be used else one can end up in finger twisters(worse than tongue twisters). This involves looking ahead(and learning to look ahead is really what makes sight reading possible. A good sight reader will memorize the first few bars or phrases before he plays, then play them while memorizing the next, this way he always has time... so he acts as a "tape recorder" and is on autopilot with what he is playing while he figures out the next part).
Of course one will learn to recognize chords(e.g., stacks of notes), arpeggios(chords that are "stacked horizontally"), various patterns and such. All this comes with practice practice practice practice practice practice practice practice practice practice practice practice practice practice practice practice practice practice practice practice practice. It's why most people can't play, because they won't practice.
Note that performance is not composing in the musical sense(but it is composing in the sense of putting the scribbles together in to sounds).
Contrasting all that to improvisation: Improvising is creating music on the spot. Composing is close to improvising in that a composer generally will create music "on the spot" as he builds his composition.
Improvising requires actually understanding music(although not necessarily formal music theory).
Improvising is mapping the musical elements(harmony, rhythm melody, dynamics, etc) in to sound(but if one writes it down first then it is composition). Improvising is real time composition.
For a composer to compose something good he must understand harmony, melody rhythm, dynamics, form, etc in some way shape or form. The better he understands them(even if he has no clue about music theory) the better his music will be.
In improvising one may start out with fixed elements like a fixed song structure(blues, two part form, rondo, etc), fixed harmonic progression(e.g., Am Bbb9/C D^#9 F7b5 C#b13 Dm), some melody or whatever.
Usually there is some general structure one is working with rather than just randomly sampling the entire musical space(as doing that will generally sound like crap). Even if one just sits down at the keyboard and plays something "out of the blue" there is still something one is working with subconsciously that probably was practiced in some way before more or less.
To improvise one must know their chords. By this I mean one must know how to play their chords instantly in every position, inversion, voicing, etc. Performers also generally have to know this to some degree but given that they practice the piece before hand and do not necessarily relate it to harmony(although any good performer will generally also think of chords but how they think bout them is different).
To improvise one must deal with choices. There are so many choices, one limits those choices down but there are far more than performing. Not only does an improvisor have to deal with the same issues, musically, as a performer, but also several orders of magnitude more(well, at least an order). A performer has rehearsed his music. Even if he is sight reading something new, he has rehearsed all the ways to map the notation to his fingers. An improviser sort of does that but it's much looser. He has rehearsed playing various shapes, dynamics and such but in the act of improvising he may play a combination of things he never played before. This is true for a performer to some degree but it is usually unintentional while for an improvisor it is intentional.
A way an improvisor thinks is more like this:
You have some general structure you are working in. But there is a large degree of freedom. You know your harmonies and you know just about everything a sight reader must know in terms of music theory and all that but you have to know more and better. You know your scales(all kinds, major, minor, dominant, modes, altered, etc), chords(all kinds, major, minor, diminished, augmented, extended, sus, slash, whatever), patterns(specific(licks, phrases, etc), general(e.g., you can play a Cm arpeggio but you can use it as a template to play a Csus4 arp which is replacing the m3 with a P4), dynamics, accents, form, etc.
It's far to complex for me to explain it all but basically improvising is expressing the entire accumulation of the improvisors body of knowledge, experience and being in the moment(in real time).
It is like sight reading music that is being created as you read it.
Now, when I improvise, the more comfortable I am with what I'm improvising(meaning that I'm playing things I've played before in some way(e.g., using some harmony I like or whatever but maybe melody is completely undefined) I'm not so much thinking in these terms. Same goes with sight reading.
Once you do it enough it becomes subconscious and you just learn to enjoy it. With improvising though I get to chose, say, if I want to play a b9 on a V7 chord to get a certain sound and I have to think of the implications of that(is it appropriate for the harmonic progression or the context(depending if one is playing with others, etc). I get to chose if I want to play a melody upside down or play it in 3rds or whatever. There are literally thousands of choices at any give second that one gets to(has to) choose from.
For me, the choices are, generally, second nature so the emotion I get to put in to it is what it's all about. I get to choose what I want based on what I'm feeling(it's a feedback loop type of thing). I can change the harmony if I want, I can get quite if I want, etc It's not just doing it to do it though, it becomes more than that, the music sort of becomes alive in that it sort of tells you what it wants. It's impossible to explain, you only know it when you have experienced it.
An improvisor practices using the tools of music so he can improvise when he improvises. A sight reader practices the playing written music so he can play written music when he plays written music.
The extremes are: No choice <------> Free choice.
Music lies somewhere in between.
My problem is I started on the RHS and my brain has been conditioned to make instant choices based on what I feel so for pieces of music I'm trying to sight read, specially if it's not emotionally capturing, my brain will wander and improvise. This is not a problem with someone that started on the opposite end. A sight reader who doesn't improvise never has to worry about improvising... and I guess an improvisor who never sight reads never has to worry about sight reading.
So the answer to your question is basically this: They are two different things/skill sets. Not completely independent but at the core they are different. Most people choose one or the other, like left and right handedness... Because both are extremely difficult/complex skills to master(takes many years) rarely do people do both... just like rarely will you find a great mathematician who is also a great musician who is also a great painter, etc. There is only so much time to master anything and of course nothing is ever mastered. Someone that is good is only better than others and only better because they chose to put their time in to doing that. E.g., some people are good at stealing the worlds wealth(e.g., Ken Griffin) because they spent their entire life mastering that skill... other people are good playing piano because that is what they spend most of their time doing. Some people are good at playing Bach and others good at playing Chopin... because that is what they spent their time doing.
The confusion, of course, is that people ignorant of something cannot see the details. If a person never learns how to solve fractional distillation problems they won't understand it in any meaningful way. Looking in from the outside is totally different than looking out from the inside.... completely opposite. One ignorant of something will never understand something while being ignorant of it. It's true for anything as much as it's true for everything.
So understand that I've tried to condense down my decades of experience in to a few paraphrases... and each person has decades of experience... which are condensed down in to a few outside experiences... but the reality is that things are infinite fractally complex. Improvising is like, to me, is like living a life while sight reading is more like reading a book about someones life. I'm not nearly a good sight reader as I am an improvisor though... again, I started from improvising and hated sight reading initially so.... I'm sure though if I was really good and could improvise just about anything without feeling pressure and without making a lot of mistakes then I might also have similar feelings about sight reading(similar but different). Just like improvising was difficult when I first started out and it got to the point of being almost effortless(again, like anything, some things are harder than others) sight reading should also evolve the same way. I just love improvising so much that I do it far more. I'm trying force myself to sight read more though because I'm pretty sure it too can be just as rewarding.