A substation is a technical facility located in every building served by the water loop that transfers the heat between the building and the loop water:

The heat pump

Every substation has one or more heat pumps, a thermodynamic device doing exactly what it name suggests: pumping the heat from a place to put it in another one. Everyone has at least one heat pump in his home: a refrigerator! This appliance indeed takes heat that is inside its cavity (that’s why it’s cold inside and you must keep the door closed) to put it outside its cavity (touch the grid located in the rear of your refrigerator: it’s hot when the refrigerator in in operation).

Of course a substation is a more complex thing than a mundane fridge, but the operating principle is similar:

Substation operation

The video below briefly describes how a substation operates