This is a stressful situation to navigate, but based on the numbers you shared, there is very good news. The fact that your iCloud backup (4.8 GB) is so close to the storage used on your Mac (5.02 GB) is an excellent sign. It is entirely normal for an iCloud backup file to be slightly smaller than the "active" storage on a device because iCloud uses compression and excludes temporary cache files that the live app needs to run but doesn't need to save. If your backup were significantly old or incomplete, you would likely see a much larger gap between those two numbers. This small difference implies your backup is nearly comprehensive.
Regarding your question about whether the phone continued backing up after the theft, it is highly unlikely, but that probably does not matter given the storage confirmation. Since you issued the "Erase" command while the SIM was still active, the phone likely received that command immediately, wiping it to factory settings and preventing any further backups. Even if there was a delay before the erase executed, automatic iCloud backups typically require the phone to be connected to Wi-Fi, plugged into power, and screen-locked simultaneously. It is rare for a stolen phone to meet all these criteria. The matching storage numbers suggest the phone successfully backed up shortly before the theft, likely the night before while you were sleeping.
You do not have to guess about the timing, however; you can verify the exact date of that backup using your Mac. If you go to System Settings, click your Apple ID, select iCloud, and then click Manage under Account Storage, you can find the backup file for your stolen iPhone. It will display a "Last Backup" timestamp. If this date aligns with the day of or the day before the theft, your data is secure.
Finally, as a critical security measure, ensure you keep the device in "Lost Mode" and do not remove it from your account completely. Removing it disables Activation Lock, which would allow the thief to reset and sell your phone.