Occupying a DEFENSIBLE terrain feature is different than moving through DIFFICULT terrain. The limitations on Cavalry are only for occupying defensible terrain while Pathfinder refers to the movement penalties for moving through difficult terrain..
Also, cavalry are free to assault a formation that is occupying defensible terrain, they just may not occupy it if they drive the enemy out of it.
Formations that are larger than the capacity of a defensible terrain feature can treat the terrain as if it were difficult. So a formation of 6 companies of spiders can move through a capacity 3 building as if it were difficult terrain, and since they have pathfinder they suffer no move penalty for doing so.
A question arises though with smaller formations. the Rulebook says
p55 wrote:
However, any formation is allowed to move through an unoccupied defensible terrain feature, counting it as difficult terrain is all respects.
That piece of text is, however, in the section entitled "Our Numbers Are Too Great!" and it is not entirely clear whether it is meant to apply to any formation, like it says, or only to any formation that is bigger than the capacity of the terrain feature.
If it is supposed to apply only to large formations, that severely limits the usefulness of the pathfinder ability in several instances.
My particular group plays it that any formation can move through terrain as if it were difficult, regardless of size. Of course, you don't get the Def bonus if you don't actually "occupy"the terrain.