On both fretted and non-fretted instruments, the vibrato works as a combination of change of resonating length, change of overall length, and change of tension. Many musicians simplify things when they describe how it works, and highlight only one or maybe two of these aspects. The reality is a bit more complex :)
The fret-to-string contact is a low mechanical impedance, so it reflects most of the incoming wave energy and establishes a null in the standing wave. The fret contact changes the length of the resonating part of the string. This is the key overlooked point: the overall length of the string and the length of the resonating part of it are independent.
Now, a string is a spring. If you press sideways on any linear spring constrained at the ends - be it a piece of wire, or a helical spring from a pen, you make the spring longer. Same happens to the string: it gets longer if you press on it. It happens whether you press it down towards the board, or laterally.
You can get fret action without changing the length nor tension of the string. Use a triangular rod, sized to fit exactly between the fingerboard/fretboard and the string, to provide the low mechanical impedance without deflecting the string, and thus without changing its length. You would press the string directly on top of that pseudo-fret to lower the mechanical impedance and improve the quality (q-factor) of the resonating part of the string.
But, obviously, on a fretted instrument, you not only bring the string down onto the fret - that already stretches it, but you then bring it further down towards the fretboard, making it even longer. This increases the length of the string, necessarily increasing its tension (unless the tuning pegs are loose).
You can see how the string stretches on the diagram below. Imagine that the string was painted in two sections, converging right above the fret when the string is free.
As the string is pressed down, the left (purple) part of it stretches past the fret (compare A, B and C). This is in spite of the length of the resonating string being largely the same in all three cases.
Now, when there's a nearby fret, the compliance of the string to lateral deflection (towards the fretboard and/or sideways) isn't constant like it would be in an unfretted instrument. The closer to the fret, the less compliant the spring is. And what does it mean? Suppose you deflect two identical springs the same amount: the more compliant one will experience less tension (tensile stress) than the more rigid (less compliant) one.
Thus, a string right behind the fret is a rather nonlinear spring, and the closer to the fret you press it down onto the fretboard, the more tension you introduce into the string. Note that the length of the resonating part of the string has not changed, but the overall length of the string then increases, and the tension in the string increases as well. The higher the tensile stress, the stiffer the string, and the higher the frequency of oscillation, and thus moving the finger towards the fret, while keeping the string down to the fretboards sharpens the note.
Of course the compliance of your finger also plays a role: the less compliant it is, the more it emphasizes the change in string's compliance towards the fret. Heavily callused fingers produce higher vibrato pitch range for the same range of finger motion.
And of course, we've only mentioned deflections toward the fret/fingerboard. You can also, additionally, deflect the string laterally, to further increase the string tension. And the vibrato can be a combination of rolling motion and sideways motion of the finger.
On the diagram below, 1 is the free string, 2 is the string lightly depressed straight down, and 3 is the string bent sideways.