The shape is the catenary.
To derive it take a small section of the rope and balance the forces. The shape of the rope follows the curve $y = y(x)$.
Here the segment with length ${\rm d}s = \sqrt{{\rm d}x^2 + {\rm d}y^2} = (\sqrt{1 + y'^2}) {\rm d}x$ has weight per length of $w$ and thus the total vertical external force applied is $w {\rm d}s$.
The segment is pulled to the left by tension with horizontal component $H$, and to the right by the horizontal component $H+{\rm d}H$. But since there are not external forces along the horizontal, it means that $${\rm d}H = 0 \tag{1}$$, or that the horizontal component of the tension is always constant along the rope.
Similarly, the left side is pulled down by the cable by the vertical component $V$ and pulled up by $V+{\rm d}V$. The balance of forces in the vertical direction is $(V + {\rm d}V) - V - w{\rm d}s =0$ or $$ {\rm d}V = w {\rm d}s \tag{2}$$
The tension is also always tangent to the rope which means that at any point
$$ (\text{slope}) = y' = \tfrac{V}{H} \tag{3} $$
Next re-arrange the above as $V = H y'$ and take the derivative with respect to $x$ on both sides
$$ \require{cancel} \tfrac{ {\rm d}V}{{\rm d}x} = H y'' + \cancel{\tfrac{ {\rm d}H}{{\rm d}x}} y' $$ or
$$ w \tfrac{ {\rm d}s}{{\rm d}x} = w \sqrt{1+y'} = H y'' \tag{4}$$
The solution to the above is given by an equation of the form $$y(x) = y_0 + a \left( \cosh \left( \frac{x-x_0}{a} \right) -1 \right) \tag{5}$$
The $\cosh$ function is what gives it the catenary shape. I leave it up to the reader to evaluate $y'$ and $y''$ and prove that (5) solves (4).
Note that the point $(x_0,\,y_0)$ is the lowest point on the curve, and the parameter $a$ is called the catenary constant (with length units) describes the radius of curvature of the rope at the lowest point.