If it is a pet (not a display animal), it gets taken out and handled. Which means a high probability that from time to time the top isn't re-secured properly. Which means it escapes.
Everyone I know who has had a pet snake, has a long list of snake escape stories.
A long time ago I handled a young boa owned by a friend. It was a baby compared to the one in the photo, just four or five feet, but I was shocked at how strong the thing was. It was built to squeeze, and it was very good at that.
It eventually escaped, then reappeared a couple of months later, slithering out of a drain pipe.