The Midrash (Bereishis Rabbah 22:5) explains that Cain brought the leftovers to G-d as an offering:
And Kayin brought from the fruit of the land an offering [mincha] to
God (Gen. 4:3) - from the leftovers, [similar to] the evil tenant that
eats the first fruits and gives to the owner of the field the stunted
ones.
This is also the language of Rashi, in his commentary on Genesis 4:3:
מפרי האדמה OF THE FRUIT OF THE GROUND —of the worst fruits (Genesis Rabbah 22:5); there is an Agada which says that it was linseed (Midrash Tanchuma, Bereshit 9).
Rashi cites another Midrash (Tanchuma, Bereishis 9):
Our sages, of blessed memory, said that Cain and Abel were forty years old when Cain brought of the fruit of the ground. What did he bring as his offering? He brought only the leftovers of his meal. However, the rabbis maintained that Cain brought flaxseed, while Abel brought firstlings of his flock and of the fat thereof (ibid., v. 4). That is why it is ordained that wool and flax must not be mixed, as it is said: Thou shalt nor wear mingled stuff, wool and linen together (Deut. 22:11).31
The main point of these commentaries is that Cain brought the poorest type(s) of produce, as the Rabbeinu Bahya explains. The lesson the Torah gives us that when offering something to G-d, in worshipping G-d, we should not be avarice. This verse shows us Cains stinginess, and that that is not what G-d asks of us.
I would like to share with you the insight of the Be'er Yosef, written by Rav Yosef Tzvi Salant. The edition I share is the recently published sefer called: Be'er Yosef Selected Writings Of Rav Yosef Tzvi Salant Adapted Into English, by Rabbi Refael Wolfe. In Parashas Bereishis, the Be'er Yosef writes:
Kayin decided to bring an offering to Hashem. He brought from the worst of the fruit of his land. Hevel was also inspired to bring an offering. Unlike his brother, he brought the best of his cattle [...] If you do not make the effort, you will move downward. (Translation by Rabbi Wolfe)