Answers to this questions are distributed across the science studies literature, and are usually partial. I cannot remember a concise integrative account, and there might be reasons for that. Ethnographic studies in (Northern) laboratories report instances of researchers turning to new problems. These studies emphasize chance and local circumstances (e.g. Knorr-Cetina 1981). Literature on the role of funding councils, national evaluation systems, and academy-industry collaboration all identify influences on problem choice. I would add path-dependency and previous research, which I found a strong factor in my own interviews with researchers.
Some of the influences are discussed in
Gläser, Jochen and Grit Laudel, 2016: Governing science: how science policy shapes research content. European Journal of Sociology 57(1), 117-168.
There is of course a strong bias twoards the global North in the literature. You might also want to look at Harsh et al. in Minerva 56 (1), 2018 on computer science in two East African cities.
Harland, J., Pitt, S., & Saunders, V. (2005). Factors affecting student choice of the undergraduate research project: staff and student perceptions. Bioscience Education, 5(1), 1-19.
we explore literature in order to avoid reinventing the wheel again and to know what others have done, whether the phenomena holds true under diverse context, to know about methodological approaches they used and what possible approach is neglected...
Answers to this questions are distributed across the science studies literature, and are usually partial. I cannot remember a concise integrative account, and there might be reasons for that. Ethnographic studies in (Northern) laboratories report instances of researchers turning to new problems. These studies emphasize chance and local circumstances (e.g. Knorr-Cetina 1981). Literature on the role of funding councils, national evaluation systems, and academy-industry collaboration all identify influences on problem choice. I would add path-dependency and previous research, which I found a strong factor in my own interviews with researchers.
Some of the influences are discussed in
Gläser, Jochen and Grit Laudel, 2016: Governing science: how science policy shapes research content. European Journal of Sociology 57(1), 117-168.
There is of course a strong bias twoards the global North in the literature. You might also want to look at Harsh et al. in Minerva 56 (1), 2018 on computer science in two East African cities.
I may add this special number of the journal 'Revue d'anthropologie des connaissances'. It is very illustrative of a perspective from "science in 'non-hegemonic' countries", so I might be interesting for you to review it. It addresses some of the ideas that have been summarized above. Many of the works are written in French, though.
Nevertheless, this is a very illustrative piece for your interests included in that number and written in English is this one: https://www.cairn.info/revue-anthropologie-des-connaissances-2008-3-page-343.htm
You will find, as well, many book reviews that I believe point in interesting directions. Such as: SAUL DUBOW. A COMMONWEALTH OF KNOWLEDGE. SCIENCE, SENSIBILITY AND WHITE SOUTH AFRICA 1820-2000, OXFORD, OXFORD UNIVERSITY PRESS, 2006, 296 P.
I responded to this question 20 days ago, but realised that years ago, I had written a short article about, including other topics, why I carried out my PhD research:
Wilson, M. (2008). Snakes and ladders: reflections of a novice researcher. Nurse Researcher, 15(3) 7-14.
. . and the other article in the same journal, that also, so some extent, explains why I researched this subject:
Wilson, M. (2009). Asking sensitive questions: accessing the 'private' account. Nurse Researcher, 16(4) 31-39.
Our research was entitled 'Living with Faecal Incontinence' and I was working in this field as a specialist nurse.
I am not able to make these freely available on ResearchGate, but would be very happy to send you the final pdfs on request.