How Do Many - Many Relations Work?

I have some legacy code from Yii 1 for a relationship where the key for the relation is defined as a middle table:

{{title_contributors}}(contributor_id, title_id)

I cannot seem to fathom how this works in Yii2 now, anyone got any ideas?

Like this

Thanks, I keep missing little things in the docs like that.