The "Shank painter" secures the anchor's shank outside of the foremast rigging (shrouds and backstays) letting the shank painter go lets the anchor swing from the cathead
I sing the "New Bedford "version. I used to use this for a theme song.
Hopefully the anchor chain or cable is attached to the anchor when one does these things.