Because spirits are essentially pure energy, and it's similar to electrical energy. They can tap into it and use it, it's all about vibrational frequencies. They've been known to "make phone calls" - I had just such a bizarre experience - among many others while living in my 500-year-old cottage in England, thanks to a particular spirit.
She also did other things with electrical or electronic items in our home. As used to spirits as I was, I'd never experienced THIS kind of stuff, or the other things she did, so it was kind of creepy even for me, but I did eventually get used to her antics.
I'm not trying to get extra reads here, so I'm reluctant to suggest this, but she was very busy and as you seem to be interested in this sort of thing, I want to let you know about a short series I wrote here. (Need to add more to it one of these days).
It's in a list and if you scroll to the bottom of it, you can learn the story of who she was before she was murdered. At least, this is the speculation in that part of England. She's rather famous locally. And then follow on and read the bizarre things she did.
https://libertyforrestauthor.medium.com/list/true-ghost-stories-823d46d1f17a