Stamina as you know, is for questing through the story and gaining EXP
Attack, is a gauge of the cost of your pirates. So basically, you would need a lot of attack for high cost pirates. They must be less than or equal to your total attack. You lose an amount of attack equivalent to the total cost of your attacking crew.
Defense, is a gauge of the cost of your pirates as well. However, this decreases as you are attacked by other pirates. The higher your defense, the more "likely" you'll be at full capacity to defend. Not 100% sure how they calculate losing defense points, but I lose about 10-15 points after each attack
On to strategies, i put a good balance in between the three stats. I first loaded up on Stamina to level up fast, and then you can load attack and defense. For example, my current stats at lv 46 are: ATK: 126 DEF: 131 STA: 60
Pro Tip: It might be a bit unethical but you can also go full STA and level up fast. Then, when you're content with the amount of exp you can get or so, you can unfriend people to lose 3 STA. As you know, adding friends can increase stats by 3 for each friend. So, you can transfer stats from STA to ATK or DEF by using this technique.