Balding is purely associated with genetics and it has nothing to do with wearing caps, shampoos, hair gels and environment--unless you were exposed to radiation at Fukushima.

My identical twin friends have finished reaching that full male pattern baldness and they're 26 now. Then we had a kid in high school who was halfway bald by 18. My father, like his brothers, was completely bald by 24. But I'm holding out well at least for now (knock on wood.) My maternal grandfather was not bald, and my mother's brothers in their mid 40s and 50s now are not balding either.
Some studies link the balding gene through our mother's genes; though our mothers are carriers and don't go bald themselves. I think it's kinda of 50/50 thing from both of our parents. At least there are options to stop hair loss and if you start early, you can keep the hair you have now.