But if Cain was a farmer,how can he sacrifice an animal(anything that has life)?
Cain had to sacrifice whatever he had sowed.
I think,its the importance both of them gave to God.
Cain brought some of the friuits, may not be the best.But Abel brought the best.
God sees the heart and not the offering.Its more like the heart's of these two brother's ,God sees.
Genesis 4:7 says what God speaks to Cain.God asks Cain,"If you did what was right,will not you be accepted?".
Which means Cain did something not right.
Therefore God rejected his offering.
Remember the story of a widow ,who offered 2 coins.Jesus said ,she was the one who gave more.
Offering is accepted by God,when its given with true heart.
Prayers are accepted by God ,when people worship in truth and from heart.
psalms 51:17 broken heart is a sacrifice to God .
I conclude saying,God looks at the hearts of the person who offers.