(idiomatic) To cease participating in an activity that has turned to one's disadvantage, especially out of spite, or in a way that prevents others from participating as well.
I don't play board games with John any more. Whenever he starts losing, he takes his ball and goes home.
Origin of take-one-s-ball-and-go-home
From the image of a group of children playing a sport with a ball that is the exclusive property of one of the participants.