According to lightingcompany.co.uk, this particular type of product is called a rise and fall light. It appears there are three types, one type in the original image uses coiled wiring to contain and release the necessary changes in wire length, and includes a spring loaded winch assembly, akin to retractable dog leashes in common use today.
Another version is represented by @Jonathan R Swift's image, using a counterweight and pulleys.
The third version encases the winch inside a decorative shell, and the winch wraps the wiring onto itself when the fixture is raised.
From the linked site:
Up and down over table lights are often referred to as rise and fall
lights and The Lighting Company has a great selection of rise and fall
ceiling lights including pull up and down pendant lights. When raised
up, a rise and fall light will give a wide spread of light and when
lowered over a table will create a more intimate dining table light.
Adjustable rise and fall pendant lights which pull up and down are a
great choice of lighting for over a dining table, as breakfast bar
lighting or for lighting over a kitchen island. The Lighting Company's
selection includes double and triple rise and fall lights with two,
three or more separately adjustable up and down lights on a bar
suspension which are ideal for lighting over larger dining tables
allowing you to choose the height of each light. Traditional French
rise and fall pendant lights and contemporary or retro style
industrial style pull up and down ceiling lights are also popular
choices.
Rise and fall lighting works best above tables and for lighting
central kitchen islands, providing light where and when it is needed.
Pull down lights also make a good choice of light fitting for a high
ceiling as they can be raised or lowered as required. Pull down
lighting can also be effective either side of the bed as an
alternative to bedside table lights. The simple rise and fall pendants
have a curly cable which allows the light to be lowered and raised
back up again. The larger bar suspensions are suspended on sets of
wires and the more traditional rise and fall lights have a balanced
counterweighted mechanism to control the up and down movement of the
light. The Lighting Company's selection includes traditional, classic
and period rise and fall lights as well as modern rise and fall
suspensions. The Lighting Company has a large selection of over table
lighting, pendant lights that are also worth considering.
Retractable rise and fall pendant lights have a spiralled cord which
you can push up and pull down to alter the lighting effect. The other
style (which tends to be more traditional), is a winch and pulley
style light.
The above section covers the "what is it called." The how it works portion is relatively simple.
A drum or winch body includes a spring and ratchets. The flat coil spring (typical) is lightly loaded when the winch body is fully loaded with the wire/cable being retracted.
As the cable is pulled out, the spring accumulates tension. When the desired length is reached, a small release of tension on the wire causes the ratchet teeth to engage, holding the cable at that length.
Ratchet mechanisms vary, but most require an additional pull to effect the release, which allows the spring to retract the cable to the desired location.
Links abound for this information, but my contribution is from direct exposure by dismantling various spring loaded products and examining the works.