The purpose of a lamp socket ring is to secure the lamp socket in place within the lamp base. It contributes to the functionality of the lamp by providing stability and support for the socket, ensuring that the bulb remains securely in place and making it easier to replace the bulb when needed.