If you look at things scientifically, the amount of muscular contraction is derived from your nervous system, which gets triggered by the brain. So the original source is the brain, where it sets everything in motion.
So, said in another way, your body is actually mental.
Depending on how much "effort" is applied is determined by the perceived efffort.
When there is a perceived threat or something that elicits a strong emotional response, like performing in front of an audience, the brain sends a signal of high stress and arousal to the body to get into life saving mode and employ more strength.
The brain actually puts limits on the body. In a normal state, we only lift about 30% of our maximal strength.
There is a reason for this. The brain is interested in self-preservation, so by limiting it's total maximal output, it protects the body from injury.
Your physical build up can handle only a certain level of load-bearing weight before a muscle or ligament tears. But in dire situations, like when a boulder is about to crush you, the brain pulls all stops and does whatever it takes to save itself.
So, how can you make use of this knowledge?
First off, you still want to train safe, don't try lifting more weight than you think is possible, to prevent injury. Instead use it when you are fatiguing, realize that you still have 70% still in the gas tank from when you feel like you're about to quit. Command your mind to do just one more, and then after one more, try one more. Make it very small increments, because it's easy to think you can do just one more.
Also know that when your brain is saying that you're exhausted and can't do anymore, it's actually lying to you. It just wants to take a break. So override that.
But also remember to listen to your body, when you are feeling actual pain, that is a signal that you may be injuring the body. So there is a fine line between knowing when to push it and when to let up.