I think part of it is immunities you develop as you grow up. I grew up with a lot of mosquitoes around and never got bitten. I would go outside with folks not from the area, and they would all start getting bitten while the mosquitoes ignored me. Figure as I grew up something developed in my blood that was not attractive to them.
I probably drink too much beer. I don’t get bitten by mosquitoes. Even yellow jacket and bee stings don’t bother me. Five minutes after getting bitten by them the mark is gone. I do consider myself lucky. I just wish I understood the “why” of it.