When an alkyl group is attached to a π system, it acts as an electron-donor group by the process of hyperconjugation. To understand this concept better, let us take the example of propene.

This type of overlap leads to a delocalisation (also known as no-bond resonance) of the π electrons, making the molecule more stable.
