Why do guys like to make you feel stupid?

Iv noticed when I'm around some guys, they sometimes say things to sound smarter. When I fumble my words or don't know the answer embarrassed, they have this sly little grin, like they enjoy that I felt embarrassed.

do guys like to do that to girls they like? I'm very confused.