How to specify a redis server for caching and another for locking?

I’ve seen that on the famous TUBerlin deployment of Nextcloud, two redis servers were configured. I hear that often it can be an advantage to have one Redis for file locking and other for caching. But how to configure both to different servers, as here.

And how/why does one redis talk to each other if they are doing different caching?

My assumptions are only based on the above file. I am just trying to understand here, as I haven’t seen a redis configuration where two redis servers sync with one another, except for clusters and master-slave.