Here is reply:
basically programs Will work out of the box.Only when you will start accessing the SPI or I2C, you need different library or Arduino core base code.
even though nrf52 and rak473 are essentially ARM processors, However their base SDK implementation of SPI and I2c drivers will be different bacuase of the different peripheral arrangement and different register configuration.
Hence even though the Arduino code will be mostly same...the internal implementation of SPI and I2C library will be different Hence you need to download the 'board variant' files in order for your code to work for a particular board….
one good example is that you will find github repo I for the itracker will have some specific board variant files.
Also another change is that of pins....for eg nrf52 may have different set of i2c pins and realtek may have different set of i2c pins....this config is also specified in the board variant files
Hope this can be helpful