Training to failure (meaning you did as many repetitions as you possibly could have on an exercise set) tends to be a bit of a controversial subject. Some believe you should almost always train until failure, whereas others may suggest that you should always leave a few repetitions in the tank. I believe the answer lies somewhere in the middle.
In recent months, the concept of effective reps has become very popular. This concept states that the closer to failure a repetition is, the greater the hypertrophic stimulus that rep has. In theory, this makes sense, given that the closer to failure an exercise is, more motor units (A motor nerve and all the muscle fibers that it innervates) are recruited. This especially holds true for lighter loads, as loads of 80% of 1rm or greater already have full motor unit recruitment from the get go.
Here's where i contend with the theory of effective repetitions. YES, reps closer to failure may have a greater hypertrophic stimulus, but they will also cause a much greater amount of fatigue compared to leaving a couple reps left in the tank. This fatigue will then limit your ability to perform optimally in subsequent training sessions, and therefore limit the total amount of training volume you could have done had you just left a couple reps left in the tank.
Total Training Volume
Total training volume (Sets*reps*load) appears to be the most important factor when it comes to hypertrophy. One of the most common strategies to increase training volume is to utilize a 2-3x a week frequency on an exercise or muscle group. Doing so will allow you to distribute training volume throughout the week and accumulate greater amounts of volume while still being able to recover from each training session.
Here's an example: Lets say you squat 1x a week for 6 sets of 6 reps. If you were to split that into 2 training sessions and on one day you do 3x6, and then 4x6 on another. You then did an extra 6 reps overall which would result in a greater amount of hypertrophy over the long run. Each training day is then less stressful but overall you did more volume. Now lets say on the first day you did your last set to failure and got 9 reps. Then on your second day you feel like crap and can't complete your 4 sets of 6 reps. You then limited your overall volume because you trained until failure on that first day. With that said, i think there are certain times and situations in which training to failure may provide a benefit.
4 situations that may benefit from training to failure
1. Lets say you train Monday-Friday and take the weekend off. If you were to take the last set of each exercise on Friday to failure, you would then have 2 days to recover. This strategy will allow you to take advantage of the benefits of training to failure, without compromising total training volume.
2. If you have a very limited time to train, doing multiple exercises until failure may be a useful strategy to make the most out of your short time in the gym.
3. If you want to test strength. Doing a set until failure at the end of the week can be a useful strategy to test strength levels. Or also just testing a 1rm, which at times might involve failing an attempt (although i don't recommend doing this often, as it may enhance the risk of injury).
4. Accessory exercises (meaning single joint exercises such as curls and triceps extensions) can be trained until failure more often. Smaller muscle groups recover faster than larger ones. Therefore, these exercises can be performed until failure more often than exercises using larger muscle groups such as squats and deadlifts.
Overall, i believe the majority of ones resistance training should not be done to failure. Leaving somewhere around 2-4 reps in the tank on most exercises will provide a level of difficulty sufficient enough to result in hypertrophy, but without the negatives. However, as previously mentioned, i do believe there are certain circumstances that do benefit from training to failure.