The missions of the NIH (National Institute of Health) and the NSF (National Science Foundation) are very different.
NIH mission is to support research for health and medical advances. While the NSF mission is on science and engineering with an eye towards expanding our basic understanding of the natural world, not for clinical or health applications. Research that is not directly applicable to medical or health advances is colloquially referred to as “basic research.” In short the NSF funds basic research, while the NIH funds medical research. The NSF is the major funding source for mathematics, computer science, and social sciences. While NIH is the major funding source for genetics, cancer, biotechnology, preventive neuroscience, women’s health, brain disorders, infectious disease, and behavioral and social science.