The operation replaces the damaged joint surfaces. It consists of a metal replacement for the ball component and a plastic cup for the socket.
The main reason for doing the operation is to reduce the pain in your shoulder. Ultimately you may also have more movement in your shoulder. This depends on how stiff the joint was before the operation and if the muscles around the shoulder are damaged and unable to work normally. If the muscles are badly damaged, then only the ball part of the joint is replaced.