Generally, the last bit of the chain or warp (known as the "bitter end" - true) should be attached to the boat with a lashing of light line. It is not intended to take any anchoring load (that's the job of a substantial deck cleat or bollard), but saves the embarrasment of it all slippimg over the side. In an extreme conditions on an exposed anchorage, it may prove impossible to weigh anchor. Then the lashing can be easily cut to release the boat to make for safety. There is often a metal pad eye in the forward face of the anchor well/locker to fasten the lashing to.
I'm glad you discovered this whilst ashore!!
Phil
Phil
Seal 22 "Sealark" Sail No 54