Just like us, babies have a mental model of how they think the world works. When something unexpected happens, it challenges what they'd previously believed. So they have to take in new information that will enable them to piece together a more accurate picture. It's why you'll see them repeat actions many times. They're testing to see if their understanding was correct.
You'll also see them modify their actions to see what difference it makes. They drop food from a high chair. How did it land? What was the impact like? Did it bounce? What sound did it make? How do those outcomes change if I drop it from higher up or lower down? If I throw instead of drop?
The longer they stare at something, the more interesting they find it. The more interesting it is, the more unexpected it must have been.
It's why they like to drop food from their highchair. They want to see what happens.
And there you were thinking they did it on purpose to annoy you!
Look around the room now. Is there something that works in an unexpected way? Or that has a new texture or sound or taste?
What would your baby delight in discovering?
(Clue: it's not another toy.)