The Witcher is packed with references to old Slavic and Polish folklore and mythology, but one element might baffle viewers: the "Law of Surprise." So, what is the Law of Surprise, anyway? According to The Witcher, it's an ancient tradition of repayment that is pretty much what it says on the label: a rule that invokes a "surprise" as payment for a good deed.
It's invoked by a helmeted knight named Duny, who shows up at Princess Pavetta's betrothal competition to claim her hand outright. He explains that he saved King Roegner's life long ago and that in return, the king offered him anything he wanted. "By tradition, I chose the Law of Surprise as payment. Whatever windfall he came home to find would be mine," Duny says. Roegner had returned home to discover that his wife was pregnant, so that "surprise" — aka Pavetta herself — belonged to Duny by the rights of the Law of Surprise. Fortunately for both Duny and Pavetta, things ended up working out in a much less icky way: Duny didn't plan to ever claim the girl, but he and Pavetta met by sheer chance and ended up falling in love behind her mother's back, so his arrival at the ball isn't about claiming a stranger as a possession that's owed to him, but invoking a tradition so that he and Pavetta can marry for love.
As it's later described, the Law of Surprise allows the claimant to take "that which you possess, but do not yet know." Eist later explains the situation further: "Asking for payment with the Law of Surprise is as old as mankind itself . . . it's an honest gamble. As likely to be rewarded with a bumper crop as a newborn pup. Or a child of surprise. He could not know. Destiny has determined the surprise be Pavetta . . . Who are we to challenge destiny?" That idea of destiny pops up in the Duny-Pavetta situation: Duny intended to ignore or refuse to accept what was "owed" to him by the Law of Surprise, but ended up meeting her and falling in love with her anyway, making the end result the same.
There's another twist to the concept, too: the idea of a "Child of Surprise." The phrase can simply refer to an unborn child, and the books that The Witcher is based upon heavily imply that witchers often invoke the Law of Surprise to gain children they can train as witchers. Geralt himself ends up invoking the Law of Surprise later on: his saving Emhyr var Emreis results in him being given the child Ciri. It's often viewed as more than just a tradition — it's viewed with the same weight as destiny itself, which is why it's such an important part of The Witcher lore.