Why was Able accepted and not Cain?

Please explain why Abel’s offering was accepted and Cain’s rejected.

In general terms, it was because Abel’s offering pleased the Lord and Cain’s did not. Abel’s pleased him because it was according to his will and Cain’s was not. Did they know this will that is, had God given commandment concerning these offerings? It is nowhere said he had; yet it is hardly reasonable that God placed a penalty on a course without giving man warning of the evil he would incur. We think it not probable that man would have brought an offering without a command from God. If he commanded the offering, he doubtless gave commands as to the kind of offering that would please him. The reason the lamb was pleasing to God was because without the shedding of blood there was no remission.