Relay clicking, battery draining

I’m hearing a relay clicking, exactly every 10 seconds. It’s a 2011 Subaru Outback, and the relay is somewhere under the passenger front seat. The battery is draining, and the car won’t start in the mornings. What is the most likely culprit? Is this a dying battery causing the relay to click? Or is there a problem in the electrical system that is causing the relay to click and the battery to die?