Indeed we say “the bill”, this is of course a joke, a play on words.
Entomology of using “cheque” (American spelling “check”) is a bit murky from my very surface level searching: www.etymonline.com/word/cheque
Seems logical is gained it’s meaning from 1812: “a counter-register as a token of ownership used to check against, and prevent, loss or theft” from “coat check”. Doesn’t seem like that much of a stretch for the meaning to then mean a token of how much you owe for the food.
‘The meaning “restaurant bill” is from 1869.’ according to this website.