Maybe she's frustrated or just had a moment of realization and that's her way of showing it.
Maybe she's got a headache or is thinking hard about something.
It could be that she's trying to get attention, or perhaps she's dealing with some sort of confusion and hitting her head out of instinct. There are various possible reasons.
Maybe she's trying to get someone's attention or asking a question.
The big acne on the cartoon girl's forehead might be to show a contrast or to create a storyline where she overcomes insecurities related to her appearance. Or it could just be a random artistic choice by the creator.
Maybe she's trying to get someone's attention or waving to someone.
Maybe she's asking for help or trying to get someone's attention.
It could be that he just realized something obvious that he missed before and is angry at his own oversight. Or perhaps it's for comedic effect to make us laugh.
The reason could be as simple as it being a natural gesture for the character in that particular scene. It might also be a visual cue to indicate something about the character's state of mind or to create a visually appealing composition.
Maybe she's frustrated with something she did or a mistake she made.
It's funny because of the unexpected and comical action. The contrast between the hand and the butt creates a lighthearted and amusing scene.