What exactly does a relay do?
A relay is an electrical switch that opens and closes under control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts.
Does it changes a +5v voltage signal from data pin to a 12V voltage signal that power up an electrical signal?
It is possible to use a relay to control 12V power on and off with +5V control signal.