The answer to autotargetting is in lua files, but sometimes it is hard to make out what really happens. First of all, if you manually target a frig with your dd, for example, after killing that frig your dd will look for any other same category ships in the area(in this case category is Frigate) and target them first, starting with the nearest. After that category is not available, the game will pick next target according to the targetting priority table, which can be found in the spreadsheets(I also compiled it in the 'hidden facts' topic in the Game stategies section). Targetting inside the same category has some randomness to it, but I found some info where it stated that generally the game will not target a ship if it has 7 or more attackers on it already, given that there's another target of the same category available nearby.
In any case, the important manual targetting like battlecruisers battles will be always done by you and include one target at a time, strike craft targetting will almost always be performed by band-boxing, and in most other cases you will specify a target and let the game do the rest while you do more important tasks.
_________________
|