To add on:
The resistance profiles are partly based on “this makes sense” the way Terak explained it and are based on the game’s lore.
The base (Tech 1) resistances for ships are:
A small increase (+10%) is added to the T1 resistance profile based on who the racial “enemy” of that faction’s ship is.
For example: Since the Caldari are the “enemy” of the Gallente, all Tech 1 Gallente ships have a slightly higher resistance to Kinetic damage (because that is the “preferred” damage type of the Caldari).
Conversely, Caldari ships gain a little bit more Thermal resistance as that is the “preferred” damage type of the Gallente.
The same paradigm is true between the Minmatar (with a preference for Explosive damage) and Amarr (with a preference for EM damage).
Tech 2 ships take this to the next level by introducing large resistance bonuses against the primary and secondary damage types their respective “enemy” faction.
As far as NPCs are concerned… I am not sure why they are set up the way they are.
If I had to speculate?
I would say the DEVs, in the midst of a chemical haze, simply said “yoooooooo… this faction deals this damage type, this pirate faction… -sips beer- … is based on that faction! So now make that pirate - BURP- faction deals that same damage and weak against it at the same time! Brilliant!”
Honestly… don’t think too hard about this. It is a VERY OLD paradigm that dates back to the beginnings of EVE. Asking for it to change now so it “makes sense” in the way you are framing it would be about as futile as asking for our submarine physics to be changed to zero-G.
See: It was originally done for “flavor” and “gameplay” reasons and now so many people are used to it that it is effective “baked” into the game. Just go with it.