Ganar vs. vencer

In Spanish, 'ganar' and 'vencer' both relate to winning, but they are used in different contexts and carry slightly different connotations.

Ganar

'Ganar' means to win something, such as a game, competition, or contest. It is also used to express earning money or gaining something.
Él ganó el partido de fútbol.
(He won the soccer match.)
Ganamos el premio mayor en la lotería.
(We won the grand prize in the lottery.)
Ella ganó mucho dinero con su negocio.
(She earned a lot of money with her business.)
Voy a ganar esa beca para estudiar en el extranjero.
(I am going to win that scholarship to study abroad.)

Vencer

'Vencer' means to defeat or overcome an opponent or challenge. It often implies a struggle or effort.
El equipo local venció a sus rivales 3-1.
(The home team defeated their rivals 3-1.)
Después de una larga batalla, vencieron al enemigo.
(After a long battle, they overcame the enemy.)
Tuve que vencer mi miedo a las alturas para subir la montaña.
(I had to overcome my fear of heights to climb the mountain.)
Venció todas las dificultades y logró su sueño.
(She overcame all the difficulties and achieved her dream.)

Summary

'Ganar' is used for winning or earning something and implies success in acquiring prizes, victories, or earnings. 'Vencer' suggests defeating an opponent or overcoming challenges and usually involves more effort and confrontation.