$\DeclareMathOperator{\Gal}{Gal}$ In my abstract algebra class, we learned about how Galois groups interact with composite fields. Namely, if $K/F$ is Galois, and $L/F$ is any extension: $$\Gal(KL/L) \cong \Gal(K/(K \cap L))$$ and $$[KL : F] = \frac{[K : F][L : F]}{[K \cap L : F]}$$
This immediately reminds me of the second isomorphism theorems. For groups: If $H \le G$ and $N \trianglelefteq G$, then: $$ HN/N \cong H/(H \cap N) $$ and $$ |HN| = \frac{|H||N|}{|H \cap N|}, \textrm{ equivalently } |G : HN| = \frac{|G : H||G : N|}{|G : H \cap N|} $$
For rings: if $S$ is a subring and $I$ is an ideal of $R$, then: $$ (S + I)/I \cong S/(S \cap I) $$ and $$ |S + I| = \frac{|S||I|}{|S \cap I|}, \textrm{ equivalently } |R : S + I| = \frac{|R : S||R : I|}{|R : S \cap I|} $$
If $K$ is replaced with $H$ (or $S$), $L$ with $N$ (or $I$), and degree with index, these become the same. I can see the connection between the field and group versions with the Fundamental Theorem of Galois Theory, and the group and ring versions by just verifying that multiplication still checks out. But it feels like this is a statement about algebraic structures in general.
Is there a way of showing this holds for certain kinds of structures? It feels like a problem for homological algebra or category theory, but I don't know enough about either to tackle it myself.
EDIT: More examples. The second isomorphism theorem for modules fits this mold, and it's proved pretty much the same as for rings.
In particular, this works for vector spaces. But the "size function" doesn't have to be the index (which is not helpful for $\mathbb{R}$-spaces, for example), it can also be dimension (which is what's going on with the Galois groups). The Subspace Sum-Intersection theorem seems to fit this mold as well: for two subspaces $S$ and $T$ of $V$, $\dim (S + T) = \frac{\dim S + \dim T}{\dim (S \cap T)}$.