Part of chain hanging on the edge of table as shown in left side figure is similar to
two mass blocks connected by string passing through pulley as shown in right side figure.
In right side figure, block of mass m1 is hanging vertically and pulling the block of mass m2 by
connected string that is passing through pulley.
For the case shown in right side figure, at equilibrium, Tension T in the string balanced by weight m1g .
Since both blocks are connected by same string, same tension T pulling the mass block.
Hence at equilibrium, frciction force is balanced by Tension which is same as the weight of the hanging block m1g.
In same way, for the case of part of chain hanging down at the edge of table,
weight of the hanging part ( x ρ g ) is balanced by the tension T acting on the chain .
Where x is part of the length of the chain hanging, ρ is uniform linear mass density
( ρ = M/L , M is total mass of chain, L is total length of chain ) and g is acceleration due to gravity.
Hence same Tension pulling the part of the chain resting on the table .
Weight of part of the chain resting on the table is [ (L-x) ρ g ] .
Hence normal reaction force provided by table surface N = [ (L-x) ρ g ] .
Hence the friction force f = μ[ (L-x) ρ g ] is balanced by Tension force T = ( x ρ g ) ,
where μ is the friction coefficient
μ[ (L-x) ρ g ] = ( x ρ g ) or x = [ μ / (1+μ) ] L