Does the psak of bet din evidence the ratzon hashem ?

Does the psak of bet din evidence the ratzon hashem or is it normative law
to adjudicate in this world. Example – my friend and I agree that we will
each purchase a mega millions ticket each week and if either of us win the
big prize we will split it. I win – would bet din say it’s an asmachta so I
get to keep it? If so, might I feel ethically bound to split it anyway or
would that be wrong because HKBH wanted me to have the whole prize”? If I
gave 1/2 would I still have to give maaser ksafim on the whole thing and my
friend on 1/2?… (We never won [image: :slightly_frowning_face:] )
KVCT
Joel Rich