
Daniel I. answered 01/29/21
Inspired Music Lessons - Piano, Composition, Theory & Production
There could be a multitude of reasons ranging from practical choices to personal preference. There might be prevailing orchestrational practices like certain instruments prefer keys with sharps due to technical, performance related issues, intonational considerations or other instrumental idiosyncrasies. It may be part of a larger work, and the harmonic and tonality choices help tie the piece in question to other parts of the composition at large. Or it could even be something as simple as Brahms wanted to write something in C# that day because he hadn't done it in a while or he had some other personal reason. Sometimes it's just because the composer wanted to. Honestly, sometimes composers make bad choices and it could be that the work would have made more sense in Db! It wouldn't be the first time a great composer left people scratching their heads.