When there is a change, the setup function is executed and the virtual dom of the component is recomputed. You have no choice because it is a return in a function (setup/build).
But in Vue3, if a ref is only used in an html tag the compiler will optimize it to not recalculate the whole virtual dom.