Argmax in $k$-NN algorithm Given a query instance $x_q$ to be classified

Let $x_1,\ldots,x_k$ be $k$ instances which are nearest to $x_q$
$$ \hat{f}(x_q) \gets \operatorname*{argmax}_{v \in V} \sum_{i=1}^k \delta(v,f(x_i)), $$
where $\delta(a,b)=1$ if $a=b$, else $\delta(a,b)=0$ (Kronecker function).


If $f$ is an objective function to be optimized, why is argmax there? Can someone explain how this function gets updated. This is for $k$-nearest neighbor function.
Given a new point $x_q$, we find the $k$ closest points $x_1,\ldots,x_k$. Each one of them is associated with a cluster $f(x_1),\ldots,f(x_k)$. We assign $x_q$ to the most common cluster among $f(x_1),\ldots,f(x_k)$. The argmax equation is just a fancy way of expressing this idea: for any cluster $v$, the quantity $\sum_{i=1}^k \delta(v,f(x_i))$ is just the number of $x_i$'s which are assigned to cluster $v$, and the argmax picks up the cluster $v$ maximizing this parameter.