Most mechanical keyboards have a metal plate in which the key switches are mounted. In olden days it used to be painted steel — but that can rust, so nowadays it is most often anodised aluminium, often given a brushed or sandblasted finish before anodising to mask imperfections.
Because metal is considered to be more "premium", manufacturers found that if they exposed the anodised aluminium plate they could sell it as having a "aluminium case", with no real extra cost.

Other than that, it is about trends.... For instance, brushed black-anodised aluminium was really trendy for computer equipment not long ago (just like glossy black and coloured transparent plastic decades before, respectively ...). If not real metal, the brushed pattern was often imitated in plastic.
The gaming-oriented mass-retail brand Corsair was early with an exposed kinked plate, in brushed finish. Now though, brushed finish has gone out of style a bit I think, and most new keyboards with exposed plate tend to have a sandblasted finish.
Apple were not first but they had spearheaded the trend with anodised alu computer equipment. Many brands have tried to imitate them but failed to make it cost-effective. Apple succeeded because of a very streamlined assembly line producing high volumes of the same parts for years, whereas PC brands change more.
A piece of sheet metal with one or more bends in it is
much cheaper to produce than CNC-milled metal case that covers the sides — and you would have to make that sheet metal part anyway.
I suspect that one inspiration for this back in the beginning could also been homebrew keyboards that had a sandwiched case construction where the plate was the top because that was easier and required less material.