With nothing better to do they discovered by accident that things in the environment make marks on other things. Then they found that the things they made marks of looked like things in the environment.I once visited the caves at Altimira, Spain and wondered why some cave man did the famous paintings there some 30,000 years ago. I don't know the answer, but I'm reasonably sure we share the motivation.
It took 30,000 years to get to the stuff that looks like things that make marks on things that don't look like things in the environment. We call that Art.