What is the best predictor of outcome after total hip or knee arthroplasty?

Many factors. Contributors to outcomes following joint replacement include patient and surgeon factors. While a technically well performed replacement will help the eventual outcome, the patient controls most of the factors; such as preoperative fitness, range of motion, and postoperative drive to rehabilitate.
Many factors. The first factor is that the procedure was done well, meaning the implants were installed properly and the knee ligaments were balanced well. Then it is up to the patient to do their rehab properly. For hips, the implants need to be installed properly, the tensioning needs to be proper, the alignment of the parts needs to be correct and then its time fro the patient to do their rehab properly.
Preop function. The most reliable documented indicator of post op function is preoperative function. The better the pre operative function and strength are the better the outcome.
2 things only. Repeatedly documented in peer reviewed medical studies-the two factors which predictably lead to good results after total knee and hip replacement are 1) a high volume joint replacement surgeon, and 2) a dedicated high volume joint replacement program/center.
Patient motivation. Assuming that you have a good surgeon, and the surgery is appropriately indicated, patient motivation and participation in physical therapy is the most important predictor of a successful outcome.