Every file has a header. Basically a string of information encoded within the file that helps programs identify what kind of file it actually is even if you rename or even delete the extension. A good image viewer will be able to identify based on that.
If Photoshop can't do it, then that just means it doesn't bother checking for the right file format or it's just a bug.
Tsikura t1_ixts9hf wrote
Reply to ELI5: In recent years, new formats like webp and jfif have started popping up. However, if I rename them to gif or jpeg, they still work. How can it be that renaming the extension doesn't ruin the image format? Why do they even exist then? by Luthemplaer
Every file has a header. Basically a string of information encoded within the file that helps programs identify what kind of file it actually is even if you rename or even delete the extension. A good image viewer will be able to identify based on that.
If Photoshop can't do it, then that just means it doesn't bother checking for the right file format or it's just a bug.