I guess this would sort of depend on what kind of keyboard you have. If you have an expensive mechanical keyboard and are traveling outside tech hub airports, you might want to pull it out and put it into the bin. I have a travel Logitech keyboard which could get checked as it is as thin as a folded t-shirt and fits in a packing cube with clothes.
I wouldn't put a pricey laptop in checked luggage. People do. I might pack an inexpensive Chromebook in a check-in if it is one of those more durable educational-style units. It isn't solely the loss/theft of the unit but also the personal information which is usually present on a laptop which could be stolen if you don't password protect & encrypt. If there are people who steal credentials over public wifi (and there are) then I also assume there are people who steal/access unattended hardware for the data (and there are).
Luggage also gets stacked in addition to tossed or thrown. A hard sided bag with clips/hinge (vs zipper) which is filled with soft items like clothing around fragile objects fares a bit better at the bottom of a stack than frameless soft sided bags (duffels, some lighter weight luggage, backpacks).