Isn't it that he raised the flag, showing where he is, so that the enemies assuming they are trying to get to the king would follow him instead of attacking the city?
Probably did. Also most likely she completely did not pay attention as it didn't involve her being the Hero Princess who Defeats the Demon Lord...
This besides the fact that there's... quite some difference... between knowing things theoretically and actually doing them.. especially in this context...At both ends...