Most text books which over this Concept generally hand-wave or gloss-over the mathematics behind the Equations.
Yes , I agree with OP that it is not very clear why $ \frac{\partial f(x,y,p)} {\partial p} $ must be $0$.
Eg , the given wiki brushes-off the Issue by claiming $f(x,y,p_1)=0$ & $f(x,y,p_2)=0$ , hence $f(x,y,p_1)-f(x,y,p_2)=0$ & almost "magically" , it concludes that $\frac{f(x,y,p_1)-f(x,y,p_2)}{(p_1-p_2)}=0$ , which is not intuitive : (1) Why not divide by $(p_1-p_2)^2$ ? (2) Why not say the Same for Elementary Differential Calculus to claim that $dy/dx=0$ always ? (3) Why not consider $\frac{\partial f} {\partial x} = 0$ with Same logic ? (4) Why 2 Criteria are enough ?
In short , the given Derivation is incomplete or inaccurate.
It is similar in most other text books too.
I will try to give my intuition & then I will give the Correct Derivation.
Best (Complete) Derivation I came across was in Myskis (Mir Publishers) "Introductory Mathematics for Engineers" & my Elaboration (Calculation) will be utilizing that.
It may look a little too long but it is essential very simple.

Consider the Black Envelope & the Grey Isolated Curve & the family of Curves which have that Envelope.
When the left-most Grey curve is intersecting on the left (Point $A$) , the tangents (to the curve & to the Envelope) are Positive but not equal.
At the Intersection on the right (Point $B$) , one tangent is going up while the other is going down.
Naturally , we can see that the Grey Curve can not have the Envelope shown at that Point.
Let us ignore the Grey Curve , which is not in the family of curves & is shown to high-light what the tangents must be like.
Consider the right-most Purple curve.
The tangent to Envelope & the tangent to Curve are coinciding , having Exact Same value at $E$ , the Point of Contact.
This is what we want from 2 Consecutive Curves.
Consider the Central Blue Curve corresponding to some $p$.
To the left , we have the Curve corresponding to $p - \delta p$.
To the right , we have the Curve corresponding to $p + \delta p$.
The Points of Intersection are $C$ & $D$ which lie on the Curves hence $f(x,y,p)=0$.
$C$ : Intersection of $f(x,y,p - \delta p)=0$ & $f(x,y,p)=0$
$D$ : Intersection of $f(x,y,p)=0$ & $f(x,y,p + \delta p)=0$
We can not make $\delta p \equiv 0$ , because all Points between 2 Curves will be Common.
When $\delta p$ tends to $0$ , the Points $C$ & $D$ get closer to the Envelope & will eventually lie on the Envelope.
Here , hand-waving intuition : $f(x,y,p + \delta p) - f(x,y,p) \equiv 0$ , $\frac{f(x,y,p + \delta p) - f(x,y,p)}{\delta p} \equiv 0$ , hence we can "eliminate" $\delta p$ by taking limit when it tends to $0$
Derivation (utilizing material given by Myskis) :
We have $f(x,y,p) = 0$ on the Curves & on the Envelope.
Let $p=C$ , some value , corresponding to a Point on the Envelope , hence $f(x,y,C) = 0$.
Let $y_{envel}(x)$ be the Envelope , while $y_{curv}(x)$ be the Curve at the Point we are focussing on here.
When we move along the Envelope (varying the $x$ co-ordinate) , naturally $C$ will change , that is , $C=C(x)$
Partially Differentiate the given function to get :
$\color{blue}{\frac{\partial f}{\partial x} + \frac{\partial f}{\partial y} \frac{dy_{envel}}{dx}} + \color{green}{\frac{\partial f}{\partial C} \frac{dC(x)}{dx}} = 0 \tag{1}$
When we move along the Curve (varying the $x$ co-ordinate) , we keep $C$ Constant , that is , $\frac{dC}{dx}=0 \tag{2}$
Partially Differentiate the given function to get :
$\color{blue}{\frac{\partial f}{\partial x} + \frac{\partial f}{\partial y} \frac{dy_{curv}}{dx}} + \color{red}{\frac{\partial f}{\partial C} \frac{dC}{dx}} = 0 \tag{3}$
At the Point of Contact between Curve $y_{curv}(x)$ & Envelope $y_{envel}(x)$ , we want the two tangents to be Equal , that is , $\frac{dy_{curv}}{dx}=\frac{dy_{envel}}{dx} \tag{4}$ , which will Equalize the 2 blue Parts in (1) & (3)
In (3) , the red Part is $0$ , hence the remaining blue Part is $0$.
We can plug that into (1) to make the green Part $0$.
In general , We know $C(x)$ is not a Constant in green Part , hence we are left with $ \frac {\partial f} {\partial C} = 0 $
Thus we got what we wanted : $\frac {\partial f} {\partial p} = 0 $
Most text books avoid the Elaborate Details & simply hand-wave to give the Criteria. The exception is Myskis who has given the Details.