Image.scr folder

Recently I came across a folder named as image in my friend’s usb which was in screen saver format I didn’t know this at first so I doubled click on the folder and a new file named temp was created which when I opened gave me details of some cryptocurrency mining I’m curious how can a folder be executable?
Whats happening in the background? How do people create this can you please let me know?

It wasn’t a folder I dont think. The icon may have been changed to look like a folder. Malware is often put in .scr files. Look at volume 4 and check your system for rough processes. Folders can not execute.