I see where you’re coming from, however, I agree more with Andrew.
This is a wonderful 5-min video that illustrates just how creative harmony can be, and what a process of composing/arranging looks like when you start with a melody: https://www.youtube.com/watch?v=eRkgK4jfi6M&t=4s (I hope you enjoy it as much as I do)
I don’t think this is a question of “degree” , so much as it is a question of “what kinds of processes do people employ to compose songs?”.
People write songs in multiple ways, sometimes they condition the melody on the harmony (by playing the first 4 chords that they learned to play on an instrument), which constrains the probability space of the melody to a select few notes (this is the process that can indeed be modeled quite well with Markov Processes)
And in other times, people write a melody first, and then the space and the number of choices you can make when harmonizing and arranging is infinite! (and more fun!)