esp_reset_reason is a public API provided in IDF, you can find the description here:
https://docs.espressif.com/projects/esp ... set-reason
rtc_get_reset_reason is a lower level function implemented in the ROM code, which simply returns the reset reason value captured by the hardware. As such it can't distinguish between various causes of software reset (for example: esp_restart() being called or a CPU exception occurring). Return values of this function are chip-specific, the values can be found in rom/rtc.h header file.
In pretty much every case in an IDF application it is better to use esp_reset_reason().