I have began learning instruments before and fell into the trap of asking too many "why" questions and then just got lost in music theory that a) didn't make too much logical sense and b) didn't help me actually get better at an instrument in any way.
I think it's very unlike programming where you could start with a hello world program and keep asking "why does it work like that" questions and keep getting deeper and deeper and actually end up with a very good understanding of computers by the end of it that actually would make you a better programmer.
But when you're learning an instrument I think perhaps at the start it's better to just accept that "chords sound good because they just do" rather than going off down a complete rabbit hole.