Question about the chain rule.
If you want to see why this works fundamentally, we can derive it from the definition of derivatives.
$$ lim_{h\to0} \frac{f(x+h)^2 - f(x)^2}{h} = lim_{h\to0} \frac{(f(x+h) - f(x))}{h}(f(x+h)+f(x)) $$
The first term becomes $f'(x)$ and the second term becomes $2f(x)$. So the limit is $2f'(x)f(x)$. If $y=f(x)$, you can convert this to Leibniz's notation to get $\frac{dy}{dx}[2y]$.
It might be easier to understand with the “prime” notation instead of Leibniz notation.
The chain rule says that $(f\circ g)' = (f' \circ g)\times g'$. In your case, $y(x) = g(x)$ and $f(x) = x^2$. You want to find the derivative of $f\bigl(g(x)\bigr)$, which, by the chain rule, is $g'(x) f'(g(x))$, or $y'(x) \times 2g(x)$
The term $\frac{dy}{dx}\frac{d}{dy}$ comes from the chain rule. Since you want to differentiate with respect to $x$ but your function is interms of $y$, by the chain rule first you differentiate your function with respect to $y$ and then multiply by the derivative of $y$ with respect to x. The notation $\frac{d}{dx}$ is kind of nice since it can be seen like you are doing some kind of multiplication by $1$ $$\frac{dy^2}{dx}=\frac{dy^2}{dx}\cdot 1=\frac{dy^2}{dx}\frac{dy}{dy}=\frac{dy^2}{dy}\frac{dy}{dx}=2y\frac{dy}{dx}.$$
Though I treated $\frac{d}{dx}$ as fractions ,$\frac{d}{dx}$ is not really a fraction but turns out it works like a fraction when you apply the chain rule.