Total knee replacement is a surgery performed to replace the entire knee joint with an artificial internal prosthesis because the native knee joint is no longer able to function, because it is very painful, or both, usually due to advanced osteoarthritis, and total hip replacement is the analogous operation involving the hip joint.