I have MPHL, also known as male pattern hair loss.
What is it caused by?
It's mostly caused by genetics and the male hormone dihydrotestosterone.
Is there anything you can do to prevent it?
A pill called Finasteride can treat it by decreasing the production of dihydrotestosterone.
Is it a genetic thing? 
Yes, and it affects half of males by the age of 50. Females are lucky because it only affects a quarter of them by that age.