How can developers effectively access and manipulate data from related tables in CakePHP models, such as in the example provided?

To access and manipulate data from related tables in CakePHP models, developers can use the `contain` method to specify which related models to retrieve along with the main model data. This allows for easy access to related data without the need for multiple queries. In the provided example, we can access the `Category` data related to a `Product` by using the `contain` method in the `find` query.

// Retrieve a product with its related category data
$product = $this->Products->find('all')
    ->contain(['Categories'])
    ->where(['Products.id' => $productId])
    ->first();