Why do we poo after food?

Silly question I know! But usually I will go to the toilet like the next day.

But sometimes I eat and within half hour I poo! Why does food go straight through us at times?

My nan eats and she goes to the toilet almost straight away 🫣 weird how our body works!