Let me first state what I think I know and please correct me if I'm too inaccurate or plainly wrong.
When you use a function like texture, you're requesting a texel value given a pair (u,v) of texture parameters. However, depending on the pixel size / texel size ratio, there's a filtering and resampling prior to returning the texel value, which you can actually configure in the corresponding API (OpenGL, Vulkan, etc).
As I understand it, this filtering and resampling occurs because either:
a) Many texels affect a pixel. This happens because the texture resolution is too high for the area on screen to be covered (i.e. the pixel resolution). So in order to avoid artifacts, the texture needs to be downsampled, which consists of applying a minification filter and resampling at a lower rate.
b) The same texel can affect many pixels. The texture resolution is lower than the pixel resolution. In this case, a magnification filter is used and the texture is upsampled.
Assuming the above explanations are correct, my question is: how does the GPU know which of these two scenarios are happening.
I reckon that it does by projecting the pixel area in texture space, as it is done for selecting the mipmap level. But even if that's the answer, how is this projection achieved? I'm failing to visualize it.