I can't tell what background you have, so here are some things you probably already know.

Let's start with a smooth projective curve $C$ over $\mathbb{F}_q$. We want to attach a zeta function to it by analogy with the Dedekind zeta function of a number field. The analogue of an ideal is then an effective rational divisor $D$, and the analogue of the norm is $q^{\deg D}$ (think about the case of a smooth affine curve). So we are led to define

$$\zeta_C(s) = \sum_{D \ge 0} \frac{1}{q^{s \deg D}}$$

where the sum runs over all effective divisors. **Edit:** I forgot to mention something important! This zeta function has an Euler product. Of course, that's not hard to see because of how divisors are defined, but it's still worth mentioning because it supports the argument that this really is the zeta function we want.

A purely combinatorial argument, which is explained in these two blog posts, shows that this is equal to

$$\zeta_C(s) = \exp \left( \sum_{k \ge 1} \frac{N_k}{k} q^{ks} \right)$$

where $N_k$ is the number of points on $C$ over $\mathbb{F}_{q^k}$. This definition readily extends to an arbitrary variety over $\mathbb{F}_q$ (although I am less sure if there is a direct connection to divisors in this setting), so we can adopt it for an arbitrary variety $X$.

This definition has some nice properties that make it rather natural: for example $\zeta_X(s) \zeta_Y(s)$ is just the zeta function of the disjoint union of $X$ and $Y$.

The above definition brings to mind the definition of the Lefschetz zeta function. In zeta function language, the Lefschetz fixed point theorem can be stated as follows: if $X$ is a compact polyhedron of dimension $n$ and $f : X \to X$ a continuous function, then

$$\zeta_f(t) = \exp \left( \sum_{k \ge 1} \frac{ L(f^k)}{k} t^k \right) = \prod_{i=0}^n \det (1 - tf_{\ast} | H_i(X, \mathbb{Q}))^{(-1)^{i+1}}$$

where the RHS is the alternating product of the characteristic polynomials of $f$ acting on homology. Given that $L(f^k)$ is a topologically refined version of "the number of fixed points of $f^k$," Weil was led to the following idea:

- The number of points on $X$ over $\mathbb{F}_{q^k}$ is the number of fixed points of the $k^{th}$ power of the Frobenius map acting on the points of $C$ over $\overline{ \mathbb{F}_q }$.
- So, if there were a good (co)homology theory for varieties over finite fields, one might imagine that a similar product formula could for $\zeta_X(s)$ ($X$ a variety over a finite field) hold based on the induced action of $f$ on (co)homology.

My understanding is that this idea was backed up by the working out of several examples.

As for what the signs are doing in the Lefschetz fixed point theorem, my understanding here is incomplete, but as far as I can tell the basic idea is that if you want to define a notion of trace for a chain map $f : C_{\bullet} \to C_{\bullet}$ (where $C_{\bullet}$ is, say, a chain complex of $\mathbb{Q}$-vector spaces) that is invariant under chain homotopy, I think in some sense the natural definition must be the alternating sum of the traces over the chain groups. This is invariant because it's the same as the alternating sum of the traces over the homology groups.

I am positive this is the "correct" definition but I don't really have the background to explain why.