Here's probably, at least to me, the most illuminating solution. Let $C$ be the curve defined by $ax^2+by^2-1=0$. We're essentially trying to compute $\# C(\mathbb{F}_p)$. Well, the answer, as it turns out, is $p-\left(\dfrac{-ab}{p}\right)$.
Why? Where is this subtractive 'error term' coming from? Most of the solutions don't really explain this point, they just manipulate some sums of Legendre symbols. I once taught a number theory course where this was one of the main points of the class-- to understand more deeply where this error term comes from.
The point is that $C$ is an affine curve which has a projective closure $Z$ which is the curve cut out by $V(ax^2+by^2-z^2)\subseteq \mathbb{P}^2_{\mathbb{F}_p}$. Now, this is a smooth (because $a,b\in\mathbb{F}_p^\times$) projective curve of genus $0$. Moreover, $Z(\mathbb{F}_p)\ne\varnothing$. This is clear from a simple counting argument ($\# C(\mathbb{F}_p)\ne 0$ else the sets $\{ax^2\}$ and $\{1-by^2\}$ have no overlaps, but they both have $\frac{p-1}{2}+1$ elements which would produce $p+1$ elements of $\mathbb{F}_p$ if they were disjoint). But, then classical geometry tells you that if $x_0\in Z(\mathbb{F}_p)$ then geometrically projecting away from $x_0$ gives you a bijection (isomorphism)
$$\mathbb{P}^1(\mathbb{F}_p)\to Z(\mathbb{F}_p)$$
More geometrically, we can identify $\mathbb{P}^1(\mathbb{F}_p)$ with the set $\mathscr{L}$ lines $\ell$ in $\mathbb{P}^2(\mathbb{F}_p)$ that pass through $x_0$. We then get a natural bijection
$$\mathscr{L}\to Z(\mathbb{F}_p)$$
by taking $\ell$ to the unique point of $Z(\mathbb{F}_p)$ other than $x_0$ in $\ell\cap Z(\mathbb{F}_p)$ (you need to prove that there is such a unique intersection point).
Of course, if you know algebraic geometry this has a much cleaner explanation. Namely, if $Z$ is a (geometrically integral smooth) genus $0$ curve over a field $k$ and $x_0\in Z(k)$ then $\deg \mathcal{O}(x_0)=1\geqslant 2(0)+1$ so that $\mathcal{O}(x_0)$ is very ample. But, on the other hand, we know from Riemann-Roch that
$$h^0(\mathcal{O}(x_0))-h^1(\mathcal{O}(x_0))=\deg(\mathcal{O}(x_0))+1-0=2$$
but by Serre duality and the fact that $\deg(\omega_Z)=2g-2=-2$ we see that
$$h^1(\mathcal{O}(x_0))=h^0(\mathcal{O}(-x_0)\otimes \omega_Z)=0$$
since $\deg(\mathcal{O}(-x_0)\otimes \omega_Z)=-3$. Thus, $h^0(\mathcal{O}(x_0))=2$. Since we know that $\mathcal{O}(x_0)$ is very ample we get a closed embedding $Z\hookrightarrow \mathbb{P}^1$. But, since these are both smooth curves we get $Z\cong \mathbb{P}^1$.
Anyways, the point is that since $Z(\mathbb{F}_p)$ is in bijection with $\mathbb{P}^1(\mathbb{F}_p)$ we know that $\# Z(\mathbb{F}_p)=p+1$. Note that $C\subseteq Z$ is an open subset with (reduced) complement $D=V(ax^2+by^2)$. So, we see that
$$\# C(\mathbb{F}_p)+\# D(\mathbb{F}_p)=\# Z(\mathbb{F}_p)=p+1$$
So,
$$\# C(\mathbb{F}_p)=p+1-\# D(\mathbb{F}_p)$$
But, what is $\# D(\mathbb{F}_p)$? Well, note that since we're in projective space the solutions to the equation $ax^2=-by^2$ are essentially, up to scaling, the number of solutions to $x^2=-a^{-1}b$. This is just $1+\left(\dfrac{-a^{-1}b}{p}\right)$ or, since the Legendre symbol doesn't care about inverses, $1+\left(\dfrac{-ab}{p}\right)$.
Thus, in conclusion, we see that
$$\# C(\mathbb{F}_p)=p-\frac{-ab}{p}=(p+1)-\left(1+\left(\dfrac{-ab}{p}\right)\right)$$
and we understand where this magical error term of $1+\left(\dfrac{-ab}{p}\right)$ comes from. It can't be seen from $C$ itself, but by the fact that $C$ is an open subset of a space $Z$ with good point count, and this error term is accounting for the number of points boundary of $C$ in $Z$.