Well humans have three goals-to get food, shelter, and to reproduce. Everything else kind of revolves around that. So if compassion and caring for others helps us achieve those goals, then yes we will be compassionate. Take packs of wolves for example. They take care of eachother, even the omega male who is at the bottom of the hierarchy and is often the weakest.

At first, humans just basically cared for people in their tribes and familes. But as human society became more complex and a agricultural society replaced a nomadic/hunterer gatherer society, humans started thinking of "others', even strangers as important because cooperation in such ways as taxes and commerce was essential in the growth of a civilization which in turn protected their own familes. And of course, religion comes into the picture but I wont get into that.