My first guess was that even roms from the same country or language can have several different version types.
Yes. If SMW is 512KB, it is different from 513KB. Both are US. Can also be 512KB EU and 513KB EU. Same for Japan version. Those are 6 versions of the same rom already.
So which one is correct to patch to?
Simple: every file has an ID (identification number). Why not give a ID number to every rom. This is called a hash or CRC (cyclic redundancy check). This is a math calculation. But you can have different methods (CRC-32 is the most known one, you also have MD5 calculation and SHA calculation, and RHDN actually requires those too, as you can see in the rom/iso info, but you actually need only CRC).
I'm super lost.
Not really. Once you know, that you have the correct original rom, you don't need CRC or anything anymore.
Why has one file 512KB and the other 513KB? The one with 513KB is bigger, thus it has some more data (this is the same as with some audio CD-s at the beginning - you know that thing before the song, like 3 seconds of empty space).
This (almost empty) space is a header in a rom. A leftover from the copier machine, which "turned" the phisical cart (thing which you plug into the SNES machine) into the PC file.
This data is at the very beginning (mostly 00 bytes).
So how to calculate our ID? With this empty beginning data, or without it? Note: with it everything is shifted (as audio CD song is then 3 seconds longer, than its actual length).
So you see this:
This is the ID of your SMW without the empty beginning= header (but the beginning must otherwise be in the file).
So with the empty beginning= header. A31BEAD4.
Let me load my SMW original rom in the Hasher program by snarfblam, and everything will be clear.
Now you have the correct rom. No more headers or id-s.
(make a copy of the original rom first)
apply patch, select IPS
Success (note: it will still say success, even if you patch to wrong original rom)