Producing fire is somewhat complex and not so intuitive (as far as I know). How did they figure out that?
Of course, I don't really expect any kind of historical evidence. Any speculation or educated guess works to me.
While your question isn't against the rules of our sub, early humanity and its discoveries are not really the remit of historians, who primarily study recorded history. The best educated guesses on this topic can be found on /r/AskAnthropology.