>>2221987I am by no means an expert and I am not sure how detailed an explanation you want, but when upscaling an image you need to fill in the extra pixels you added. How these pixels should be filled is determined by an 'image scaling algorithm'.
nearest neighbour is such an algorithm and simply said it fills the nearest neighbouring 'empty' pixels with the same colour as the pixel it does know (see image, from
https://tech-algorithm.com/articles/nearest-neighbor-image-scaling/) and such retaining the hard pixels.
Another commonly used algorithm is bilinear, which, again simply said, fills the empty pixels with a colour which sits roughly inbetween the pixels it does know. This creates soft edges, which is better fitted for photos for example (picture from
https://twitter.com/taranvh/status/1103031363089756161)
In photo editting programs you can often select which algorithm you want when resizing (example from Photopea: image->image size...)