This is said in a lot of contexts. In addition to what Hilary Metcalf said:
"Can you open the door?" "No, it got stuck".
"Why is the cassette tape making that horrible noise?" "It got stuck."
"Why haven't you pulled the casserole out of the oven yet?" "It got stuck, I can't get it out!"
"Why is there chewing gum in your hair?" "It got stuck..."
"Why don't you have the candy from the vending machine?" "It got stuck inside, and I couldn't reach it."
"Why aren't you on page 40 of your textbook?" "It got stuck to page 41, I can't separate them!"
It's quite versatile, and can be literal (like in the door or ticket machine examples) or somewhat figurative (like the traffic example).