Who writes the solicitations? Who writes the solicitations for funding agencies? The program directors or possibly other invited researchers.
The answer to you question is that it varies both within agencies and across agencies. 

I have seen program coordinators write solicitations by themselves. I have seen them ask for scientists working within the agency to help write them. I have seen them ask for external feedback on research priorities. I have also seen scientists working within agencies write their "statements of work" for small, project driven proposals.

To answer your question for a specific agency and program, I would ask their coordinator or someone within their agency. You might also be able to ask a faculty member who has served as a reviewer for an agency.