Sure, but knowing that doesn’t make the pain any easier to deal with.
We know that cyclists are better at tolerating the pain of a long bike ride than non-cyclists. Interestingly though, cyclists aren’t better than anyone else at tolerating the pain of submerging a hand into a bucket of ice water. Pain tolerance is peculiarly specific.
Swimmers, when they push their limits in the pool, improve their ability to tolerate swimming-specific pain. Same with runners. Same with your sport.
People who go on a lot of dates improve their tolerance for rejection. People who blog improve their tolerance for criticism.
Knowing that pain is in your head isn’t helpful in the moment, but the weeks, months, and years of practicing with pain makes magic happen.