They knew that Ireland was the better team and that Krum was the better seeker. That Krum would catch it, but not in enough time before Ireland had outpaced them.
So the twins bet on a long-shot outcome, based on both those facts, and the idea of pride--that Krum would be too proud not to.
The game ends when the Snitch is caught. They were betting that Ireland would be too far ahead when it was spotted. If it was spotted by the Irish seeker, they were betting that Krum would beat him to it, because he's the best in the world.
The odds were so far in Ireland's favor, that the point spread probably indicated that Ireland would be so far ahead that it would not matter who caught the snitch, and Ireland would still win.
They were betting that Krum would see that, and end the game on his own terms. Ireland may have had the better team, but Bulgaria had the better seeker.
It's likely that they looked at the spread, and at Krum's behavior over time in his games.
Most of the time, if the big point bump and game end caused by the Snitch being caught won't put your team over the top, you might try to keep the other player from catching the Snitch, in the hopes that your team will catch up enough, but if all hope is lost, you might catch it just so the difference won't be so much.
"What did he catch the Snitch for?" Ron bellowed, even as he jumped up and down, applauding withhis hands over his head. "He ended it when Ireland were a hundred and sixty points ahead, the idiot!""He knew they were never going to catch up!" Harry shouted back over all the noise, also applauding loudly. "The Irish Chasers were too good... He wanted to end it on his terms, that's all..."
The twins likely knew this from analysing the game and the players beforehand.
Ginny does the same thing as Krum when she fills in for Harry in Order of the Phoenix, when Gryffindor loses to Hufflepuff by 10 points (chapter 26).
They did not know it for certain, it is simply what they predicted. That's why it's called gambling.