Hypochondria, also known as health anxiety or illness anxiety disorder, is the fear of having a serious illness. Like with other anxiety disorders, the exact cause of hypochondria is unknown. However, we do know how hypochondria develops. In addition to being predisposed to hypochondria from family members who may have it, hypochondria develops from the way you think about a trigger, and how you act in response to the worry of having an undiagnosed medical condition.
So when you look at cognitive behavioral therapy (CBT), CBT says that your thoughts about a trigger induce a feeling, and if the feeling is uncomfortable, then you act in ways to relieve that discomfort. So let’s say you have hypochondria, and you start having stomach pains. This may then lead you to think that you have stomach cancer, or that you might die from this. These thoughts induce anxiety, and you then start to behave in ways to reduce the uncertainty of not knowing if you really have an illness. You then start to check yourself more frequently, and you might visit your doctor and you may be subjected to many medical tests. You also over-educate yourself into why you think you have the stomach pain. These behaviors then maintain your intolerance of uncertainty, and it continues and maintains the negative vicious cycle of hypochondria.
So to answer your question, the cause of hypochondria is due to multiple sources, including genetics (family history), how you think in response to the stomach pains, and how you behave in response to the anxiety induced by your thoughts about the stomach pains.