They found themselves standing at the Pearly Gates.
“Both of you were very good men,” says St. Peter, “but heaven is getting crowded and I can only allow one of you in. What can you do?”
The farmer planted a pear tree, and it grew huge, delicious fruits.
“Wonderful,” said St. Peter. “What can you do, your majesty?”
The king immediately went to the nearest toilet and flushed it.
Ultimately, St. Peter made the decision to allow the king into heaven.
And the moral of the story is, a royal flush always wins against a pear, no matter how big.