It's different for all the races, and something that comes from a variety of complex interactions. The text in the bottom right panel of the political screen for each race explains some aspects of how to deal with that.
Some of it is kind of out of your hands: the hive queen moods vary based on her internal hormones, and you can only kind of push her in a certain direction. She reacts to circumstances, but only in a really wide range.
The Boarines, on the other hand, tend to be more about their circumstances in a super hardcore fashion. If everything is great, they start prizing solar unity, etc.
For the Evucks, they tend to not change their attitude at all, because it's based on the head of their council IIRC. It says on the page. But you can assassinate him or a couple of other options.
Internal War is a different state from the other stuff you're referring to, though. Internal War, Growing, Stable, and Warlike are stances based on how the race is responding to their population density. If they have a lot more space on their planet than they need, they'll almost always just be growing. But if something bad happens in terms of a randomized event or triggered event that leads them into internal war or puts them in a warlike frenzy, then that will stick for a while.
Once they hit the max desired population density the planet can support, a couple of things might happen. They might go to internal war, having their population then fall like crazy until it hits 50% of the total possible density. Or they might become expansionistic and warlike. Or they might just have their population stabilize and sit at the max cap in a harmonious way.
You can't control these particular reactions; it's based around how the race is dealing with its challenges of overpopulation. What you can do, however, is control their overpopulation: that might mean depopulating them somehow (getting them to fight someone else? making something bad happen that kills a lot of them?).
Or it might mean increasing the amount of space they have on the planet -- ramping up terraforming efforts. In some cases you'll have a huge freaking planet that is barely habitable because it's a gas giant or something, but the amount of land area is just all anyone could ever want. So getting them to do more terraforming, or you doing the terraforming for them for a bit, can make a big difference there.
Then again, it could be a small iron pellet of a planet and they are simply out of room, in which case you're looking at inevitable population density issues. Look in the planet details screen, and you can see the total size of the planet, and the total terraformed size of it (so far). You can also see what the acceptable population density is for that race.
Hope that helps!