We have them in FL - first saw them over near Tampa. They ate the speaker module out of my GPS.
Cleaned them up, left Tampa. A few months later, I returned, and there they were again.
I had that same idea about them being attracted to electrical fields, but when I tried it, couldn't seem to attract them.
Another idea was that they are attracted to the heat generated. They seem to go after specific pieces of electronic equipment, even when there may be multiple items around. But, once they find something they 'like', they'll stay put even when it's turned off for long periods. They headed for my GPS unit each time I got them, and nothing else.
This makes me think there are some materials inside that they prefer to eat. Very likely an adhesive, since I found them eating the duct tape off of some cardboard. And, they went after that GPA unit whether I plugged it in indoors, or out.
I do have a fix for them, once you have them, though. Take whatever they crawled into, put it in a plastic bag. Stick the bag in the freezer for a while. You might have to take the cover off and blow the dead ant bodies out of it, but it'll kill 'em. I'd imagine a similar fix might be hacked together to get them out of ducts and walls, too.