Your issue arises because Messages and Backups in iCloud are managed separately. Even though your iPhone currently displays only two conversations (with minimal content), iCloud can still store older backups containing previous messages that don't appear directly on your device. These stored backups may explain why iCloud indicates you have 42 messages.
To view, manage, or delete these backups, go to Settings on your iPhone 15 and tap your name at the top to access your Apple ID. Select iCloud, then tap Manage Storage. Here, you'll see various apps and services using your iCloud storage. Select "Backups" from this list to review a detailed breakdown of the backups stored in your account.
Once inside the Backups section, you can see all devices linked to your Apple ID along with their respective backup sizes and dates. Tapping on a specific device will provide additional information about what data (such as apps and settings) is included. Although Apple doesn't permit viewing individual message content directly from backups, this section provides an overview of what’s being backed up.
If you notice backups from old or unused devices that you no longer need, you can delete them to free up space. To delete a backup, tap the device’s name and then select "Delete Backup" at the bottom of the screen. Confirm the deletion when prompted. Be cautious, as removing a backup permanently eliminates your ability to restore your device to that specific backup point in the future.
To fully remove unwanted messages stored within iCloud, ensure you have "Messages in iCloud" enabled by going to Settings, tapping your Apple ID, then selecting iCloud and turning on Messages. After enabling this, deleting messages or entire conversations directly from your Messages app will also remove them from iCloud.
As a final recommendation, regularly reviewing and managing your iCloud backups can help prevent unnecessary storage usage. Before deleting backups, always confirm that you no longer need the data they contain. If you're concerned about potential data loss, it's advisable to first make a local backup on a Mac or PC before removing backups from iCloud.