Use of Event catalog_category_change_products Magento 2.

Magento 2 uses catalog_category_change_products events to Checks if a category has changed products.

If you change an existing product from the category or adding new products to the category at that time, Magento use event for change products.

Declaration of the event from the vendor/magento/module-catalog/Model/ResourceModel/Category.php with a method, _saveCategoryProducts() that add logic for the Save category products relation.

create an events.xml file,  etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_category_change_products">
        <observer name="category_product_change_ids" instance="Jesadiya\CategoryProductChange\Observer\CategoryProductIds"/>

Create an Observer Class to handle the logic of the event,

namespace Jesadiya\CategoryProductChange\Model;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class CategoryProductIds implements ObserverInterface
     * @param Observer $observer
     * @return void
    public function execute(Observer $observer): void
        $productIds = $observer->getEvent()->getProductIds();

Using the above way, you can fetch all the ids of the product that was changed during category save operation.

You can check the Complete List of all events in Magento 2.