Stats earned via kingdoms only apply when fighting in that kingdom.
When creating a team you can select which flag you use, that flag will offer an extra stat or two to troops relating to that flag’s kingdom. (e.g. The Song Banner give stats to troops from Pan’s Vale.)
The final way to get extra stats is from troop bonuses. For more info on this, check here.
I might be wrong about the flag bit though. I’m not entirely sure what all applies to the console versions.