The built-in model (Spatie\MediaLibrary\MediaCollections\Models\Media) will use the default database connection set for your application.
If you need to change this database connection, you can create a custom model and set the $connection property (https://laravel.com/docs/9.x/eloquent#database-connections). See Using your own model for more information.
The Spatie\MediaLibrary\InteractsWithMedia trait defines a MorphMany relationship to the media model. Eloquent automatically uses the database connection of your parent model when querying the database. In the example below, the user media results will use the tenant database connection rather than the application's default connection.
When you save files using the code below, the Spatie\MediaLibrary\MediaCollections\FileAdder will also automatically use the parent model's database connection if that is set.
$model
->addMedia($path)
->toMediaCollection();
If you need to customise the database connection further before fetching or adding media, use you can do $model->setConnection('landlord').