Getting rejection notices, or not hearing back at all, hurts.
If you feel pained, know that your brain processes rejection as physical pain.
In our history, humans are wired to sting from rejection so we don't go off on our own which doesn't bode well for our survival.
When you experience rejection, process it. Don't say "Oh, I didn't need that job anyways". Express that you have been hurt, disappointed so you can move on in a healthy manner. But please, express your self to friends, not to the recruiter or hiring team at the company.
It's not constructive to dwell on what reasons you may have been rejected for. If you don't work at the company and aren't present for the meetings and emails between the hiring team members, you can't know for sure why you were rejected unless the company provides feedback.
At the end of the day, focus on yourself and keep going.