The Torah requires for misas Beis din (death penalty) we have to be 100% sure that the perpetrator knew what he was doing and that he didn't forget the warning/didn't know what he was doing was bad, hence one needs warning תוך כדי דיבור (within the time of a greeting to ones teacher) to warn the guy prior to his sin, see Kesubos 33a. Otherwise they'd kill someone who might have forgotten the warning and not realized what he did was wrong so even 99% is not good enough rather warn him just before he sins then we know its on purpose.
The reason why we have to be so sure is learned from Kesubos 15a (explained by Rashi):
ספק נפשות - דיני נפשות להקל דהא והצילו העדה כתיב- במדבר לה
death sentences are judged favorably towards the offender since it is written in Bamidbar 35:"The Congregation (sanhedrin) shall save" .
Note that Malkus (lashes) with regards to forewarning is the same as death sentence either because it weakens the person like death
מה לי קטלה כולה מה לי קטלה פלגא
Bava Kamma 65a
or there is a Hekesh between Malkus and Misa
(source: Tosfos Yeshanim Kesubos 36b)
However in k'nas offenses there is no such gezeiras Hakasuv that "the congregation should save the perpetrator" and require warning, therefore the Torah dictates without reason that in all the cases of Knas- Oneis, Mefateh, Motzi shem ra, Shor shenagach Eved, Keifel, Arba vechamesh- one simply pays without warning.
After all, one cannot warn an ox to not gore a slave and the owner would be liable despite his utmost care to prevent the killing e.g the ox runs away, and even if the slave is worth absolutely nothing the owner of the ox is still liable to pay a knas of 30 silver coins (see Gittin 43a).