Wipro interview question

How does a relay work?