In the past this trainability was associated with intelligence but modern studies indicate trainability and intelligence are not correlated as closely as we used to think.
In short: you train a dog, your cat trains you aka the old joke about dogs having masters and cats having staff is probably true.
"Because we judge intelligence by comparing other creatures to ourselves, many popular accounts of cat behaviour describe learning as though cats are mentally defective humans rather than highly specialised carnivores."
"How the whale got his throat" is still the house favorite, but as an adult, man, did i laugh a lot harder at "the butterfly that stamped".
Wolf packs are generally a monogamous pair with their recent offspring.
And feral cats certainly form colonies, though it seems like what research there is has the primary cat social groups being a female and her young and extending from there to multiple females and their young.[2]
Really for both wolves/dogs and cats it seems like environment strongly influences social behavior and there is a large amount of variance.
[1] https://phys.org/news/2021-04-wolf-dont-alpha-males-females.... [2] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7149619/
Larger packs have been observed in Yellowstone. I think it’s largely a function of prey density. In a case where family packs merge into a larger pack I imagine somehow the animals work out who the leader is as a necessary condition for cooperation.