According to a report by The Times

It was such a mess of a situation yesterday, with May looking like she was headed for a defeat and a motion of no-confidence set to take place. But in the dying moments, she managed to fend off the rebellion (by 6 votes!) - but really, at what cost?

You could tell how bad the situation was when there were whispers that they were considering to withdraw the entire customs bill if they lost all the votes.

Either way, the report here (may be gated) says that May had actually played the "general election card" against rebels from her own Conservatives party in order to secure her position and the votes on the bill. She told them that if she was to be defeated, a general election will be called in the summer.

For the time being, that has worked. But you get the sense that trust and harmony among the party with May herself is almost all but gone at this point.

This is likely the final Houdini act that she will be capable of, and the backlash from here onwards will only intensify further. I for one certainly don't envy May's job, not least because it is an impossible one to begin with. But it's basically an "unwinnable" job in the sense that no matter what you do, you always lose because someone, somewhere is going to be unhappy.