Let $\pi: P \rightarrow M$ be a principal $G$-bundle whose fibers are a Lie group $G$. In Hamilton's Mathematical Gauge Theory he states that
The group $G$ is called the structure group of the principal bundle.
I was left thinking that the term structure group is another way to refer to the fiber of a principal bundle.
However, I have also come across other resources (such as this question: What is the structure group of the tangent bundle?) that gives a more general definition where the structure group can be completely different than the fiber. From what I have understood of their definition, let $\pi: E \rightarrow M$ be a fiber bundle with fiber $F$. If $u$ is in the domain of two trivializations $\phi_1: E \rightarrow M \times F$ and $\phi_2: E \rightarrow M \times F$, with images $\phi_1(u) = (x, f_1)$ and $\phi_2(u) = (x, f_2)$, then the structure group $G$ of the fiber bundle is a group whose group action relates these two images, namely $f_1 = g \cdot f_2$ for some $g \in G$.
I am now a little confused on what the structure group is exactly and how it relates to the fiber of a fiber bundle, especially in the context of principal bundles. In the case where we have a principal $G$-bundle is the structure group always the same as the fiber (and hence the Lie group) $G$ or can it be generalized to another group?