For a full comparison, I would highly recommend taking a look through the datasheets for both sensors. Here are links to both: [MPU-6050 and [ICM-20948.
Both of these sensors have quite similar read ranges but the largest difference outside of form-factor and available example code is the ICM-20948 features an on-chip magnetometer along with the accelerometer and gyroscope. The MPU-6050 does not. Also, the available example code for the MPU-6050 looks like it has some minor issues with the ESP32 so you may need to do some extra work with the [example code to get it working with the ESP32. I believe the library for the ICM-20948 works with ESP32 but you may need to manually define your I2C pins where the bus is initialized. Finally, the last major difference is form-factor. The MPU-6050 has your standard pins broken out to solder headers or wire to for connecting to a microcontroller. The SparkFun ICM-20948 has both those standard header pins as well as the Qwiic connector for easy I2c connections.