Before I get in too deep, let me say that although I had piano lessons while growing up, I don't understand music theory at all, and I don't want to understand it.
The answer to your question isn't a theory question though, Marion it is a practical one. The bar lines just break down the music into phrases that are easier to practice and to play
There are some more modern composers who don't use bar lines. Erik Satie, for some reason, didn't bother with them in a number of pieces, and you have to pencil them in yourself, unless you want to go crazy.
I was laughing out loud when you said that drumbeats happen naturally, in response to the melody and didn't need to be written down! I have played as an accompanist with middle and high school musical esnsembles, and if you let those percussionists play what came to them naturally, you would regret it, and soon!