I don’t know the math behind targeting mechanism. I know they take signature radius into account, and then I know they can switch target at fixed intervals.
I also know there has been issues with drones being hated, that is the moment you launch your drones the rats all start attacking them, and if you recall them and relaunch them they do it again - which seems linked to a variable of “hate” on your ship, because while docking did not reset this behaviour, exiting the ship and entering it again did fix it. If at the same time, another ship entered the site, the rats would have normal behaviour with this other ship.
This seems to indicate (not sure though) that the ships have a hidden “ignore” value.
I’ve noticed this ratting in a VNI in anoms, but also doing the “base blood” mission, where once every 40 missions the rats hate your drones and kill them all as soon as they get out. I usually lose one drone per mission, when they get hate I lose the 25. However it’s fine, since I can perfectly track and shoot them. Sometimes I even cut down all my stuff but the launcher, because nothing else becomes useful