Hey, I'm leaving shortly for a two-week-or-so vacation; this is my last post until early March.

I previously described how you can fiddle with Pathfinder Second Edition monsters' levels, but one of the things to keep in mind is their spellcasting. This is good to keep in mind even if you aren't adjusting the monster levels, because it's a valuable window into how heavily the monsters rely on their spellcasting.

Monsters in Pathfinder Second Edition have two kinds of spellcasting: Innate and The Other Kind. Innate spells are what used to be called "spell-like abilities" in the first edition. The Other Kind is actually two types: prepared spells and spontaneous spells. The Other Kind mimics the kind of spellcasting a player character can have: either a prepared set of spells (like a cleric, druid, or wizard), or a spontaneous set of spells (like a bard or sorcerer). In essence, The Other Kind of spellcasting feels like a character's spellcasting (even though monsters don't otherwise act like PCs in Second Edition). Some of these are because the monsters are obviously supposed to hew pretty closely to a spellcasting class: the changeling exile casts spells like a druid, and even has druid order focus spells (like a PC druid would have). The drow priestess casts spells like a cleric (and even has oodles of harm spells available at her highest spellcasting level), but doesn't have domain abilities and is therefore only "mostly" like a cleric.

When determining how committed monsters are to their spellcasting role, it's useful to think in terms of Facebook relationship statuses. It's silly, but bear with me here.

Single: The monster doesn't really have relevant spellcasting. You can freely scale the monster without worrying about its spells. This includes those monsters who are only dabbling in a few innate spells, like how all duergars have self-only enlarge and invisibility options, or how doppelgängers always get mind reading. No matter what level these monsters end up being, they have these minor, signature abilities. Their relationship with their spells isn't really part of their identity. 

In a Relationship: The monster has some spellcasting they use a lot, but it's not the core of what they do. You can spot this by monsters whose spellcasting level is less than half of their creature level. A morrigna psychopomp--bounty hunter of the dead, which are awesome words to put together--is a 15th level creature, but its divine spontaneous spells (which make it sort of like a divine sorcerer) cap out at 6th level. Similarly, its innate spellcasting caps out at 5th level. It doesn't get the 8th level spells that a dedicated 15th level caster would have. If you change the morrigna's level dramatically, it should still have this sort of "dabbling but not committed" feel. 

Married: The monster has spellcasting that aligns very closely with its creature level (that is, its highest-level spells are half of its creature level). This makes them very committed to spellcasting, and it's likely what they'll do every round in combat. The raja rakshasa is a 10th level creature, and its highest level of occult spontaneous spells is 5th level. That means if you advance a raja rakshasa to 16th level, for example, it should get 8th level spells to keep this dedication intact.

It's Complicated: Monster spellcasting gets complicated, of course, and primarily does so in two ways: either there's a mix of the above, or something that just doesn't align with the above.

For an example of the former, look at the lamia matriarch, an 8th-level creature. It has occult spontaneous spells that cap out at 3rd level; they aren't dedicated casters with these, and they'd fall under the "In a Relationship" label. If you change a lamia matriarch's level, its spontaneous casting should be at least one level lower than half its creature level. But lamia matriarchs also have innate spellcasting, and this is much higher level, capping out at 4th level, as you'd expect from an 8th-level creature. So its many useful innate occult spells like charm and suggestion means it's "married" to those. This creature is both In a Relationship and Married, so...It's Complicated.

The most common examples of the latter type of It's Complicated are monsters with spell levels far in excess of their creature levels (much less half of their creature levels!). These are always innate spells, and they're thematic abilities that the monster needs regardless of its level. An example is the nosoi psychopomp; they need to speak with the dead, and so they have the 4th level talking corpse spell even though they're only 1st level creatures. Grigs (a type of sprite, in the new edition) have 2nd level spells that trick people, even though they're only 1st level creatures. Note that these are virtually never damaging effects. As a result, you can not only keep them no matter how much you scale the creature, but you can also think about even more powerful non-damaging effects to give these creatures if you advance them. For example, a grig advanced to a 7th level creature might have uncontrollable dance, an 8th level spell, and that would be okay.