I think it depends on the person . Some people have the so much talked about ,Talent and the compose music by heart and and ear. Of Course people like this that make masterpieces are very rare I guess and to become a good student you need to study a lot , music theory , harmonization etc. The topic is so relative because everyone has different techniques and strategies of composing which are learnt by books or gained by experimenting. You can choose your way or Keep experimenting and keep learning Strategies