We call a function conservative in a domain $\Omega$ if it satisfies the condition that integration around closed curves results in $0$:
$$\int_C f(z)\,dz = 0\text{ for all closed curves $C$ in }\Omega.$$
This is global property, but since it must be true about all closed curves, we can use it to see how the function must behave at points by considering closed curves near that point. Without going into the details, by taking the limit as the curve size goes to $0$, we find that being conservative requires the function to satisfy the Cauchy-Riemann conditions at that point.
So even though we started with a global property of the function, we find that it has local consequences. What Cauchy's Theorem does is to turn that around: if the function is differentiable everywhere in $\Omega$ (i.e., the Cauchy-Riemann conditions hold) and $\Omega$ is simply-connected, then $f$ is conservative. How does it do that? Well I suggest looking up Goursat's proof to see. (Goursat was the first to show that differentiability everywhere in $\Omega$ is sufficient. Before that, continuity of the partial derivatives had to be assumed as well.)
Goursat starts by proving the theorem for rectangles, dividing the rectangle into four smaller rectangles and noting that the integral around the original is the sum of the integrals about the smaller rectangles. Keep doing this until the rectangles are so small you can accurately estimate the values of the integrals by the derivative of the function at the center of the rectangle. He then showed that as the size of the rectangles decreased, the estimated integral went to $0$ faster the number of rectangles increased. So value of the integral around the original rectangle had to be $0$. Then he used the proof for rectangles to show that the integral about all closed curves had to be $0$ as well. A small generalization shows that $\Omega$ doesn't have to be simply-connected if we instead restrict to curves that are contractible to a point within $\Omega$.
Just as the global condition had local consequences, the local condition, if it holds everywhere, can have global consequences.
And this is what happens with the Cauchy Integral Formula. In it, the function being integrated is not differentiable everywhere inside the domain in question. Instead there is one point where the function is not even defined, though it is differentiable everywhere else. But if we draw a smaller circle about the point, the function is differentiable everywhere between - and I shall suppose a little beyond, which can be relaxed later by taking a limit. If we take $\Omega$ to be that slightly enlarged region, and connect the two circles with a radial line, we can define $C$ to follow one circle $C_1$ around, take the line $R_1$ to other circle $C_2$, follow it around in the opposite direction, then take the line $R_2$ back to the first circle to close it. This $C$ is contractible with respect to $\Omega$, so the integral around it is $0$. Now $$\int_C F = \int_{C_1} F + \int_{R_1} F - \int_{C_2} F - \int_{R_2} F = 0,$$ where the latter two integrals are subtracted because the integrations are taken in the opposite direction from the first two. But $R_1$ and $R_2$ are the same segment, and thus $\int_{R_1}F = \int_{R_2}F$. So it must be that $\int_{C_1} F(z)\,dz = \int_{C_2} F(z)\,dz$
That is, whatever smaller circle $C_1$ about the singular point we draw inside $C_2$, no matter how small it is, it still has the same integral as $C_2$. Now letting $F(z) = \frac{f(z)}{z-a}$ where $f$ is differentiable everywhere,
$$\int_{C(r)} \frac{f(z)}{z-a}\,dz = \int_{C_2} \frac{f(z)}{z-a}\,dz$$
for all $0 < r <$ the radius of $C_2$, where $C(r)$ is the circle of radius $r$ about $a$. For large $r$, these integrations seem intractable in general, but when $r$ is close enough to $0$, we can use the Cauchy-Riemann conditions on $f$ at $a$ to estimate the value of $f$ near $a$, and show that the limit as $r \to 0$ has to be $2\pi if(a)$. But all the integrations have the same value, and the limit of a constant is that constant. So it must be that $$\int_{C_2} \frac{f(z)}{z-a}\,dz = 2\pi if(a)$$ for every circle $C_2$ about $a$ that lies within the domain where $f$ is differentiable.
The local condition of $f$ being differentiable, when applied to every point in a domain $\Omega$ puts significant restrictions on how $f$ can behave, and because of those restrictions, it allows us to determine how $f$ behaves at $a$ based on how $f$ behaves some distance from $a$, which opens up the incredible world of complex analysis.