In Lagrangian mechanics, Lagrange's equation of the first kind states that
$$ \frac{\partial L}{\partial r_k} - \frac{d}{dt}\frac{\partial L}{\partial \dot{r_k}} + \sum_{i=1}^C \lambda_i \frac{\partial f_i}{\partial r_k} = 0. \tag{1}$$
Here the constraint functions are embedded using the method of Lagrange Multipliers. The method of Lagrange Multipliers is an optimization technique, used to find local minimas/maximas for an objective function given a set of constraints.
This leads me to believe that the part $ \frac{\partial L}{\partial r_k} - \frac{d}{dt}\frac{\partial L}{\partial \dot{r_k}}$ actually comes from applying the gradient to some objective function. But I can not find any information about this function.
So my question is, is there an objective function here and how can one formulate it? Or is my premise flawed? I would be very thankful for any help or pointers in the right direction.