Yuriy L. answered 03/21/21
Piano, Production, Theory, Music History, and Composition Tutor
This is called "orchestration," which is actually separate from theory! Orchestration is the art of writing well for all instruments and knowing what instruments can and cannot do. You do not need to be a genius to know it. In fact, you can learn most of it from books! The composers you are talking about also had a lot of experience and feedback from their performers, which is another thing that helps a lot.
If you would like to learn more I would suggest you check out the book "The Art of Orchestration" by Samuel Adler.