Doing this expands their market share, if you sell a GMC to someone who won't but a
chevy, then you have sold one more truck than if you only made
chevy. GMC started out as General Motors Commercial, and all their trucks were commercial. Eventually that evolved into basically same truck as
Chevy.
This has happened with
Pontiac, Buick, Olds,
Cadillac, Saturn, and Hummer. Also a Mercury and Lincoln (and for a little while Jaguar) are Fords, Chrysler and Plymouth are Dodges, Acura is a Honda, Lexus is a Toyota, Infinity and Datson are/were a Nissan. This has been done by every major auto-maker since the 50s,
Often times the body work is only slightly changed and different colors/options are available, but the basic chassis is the same, reducing costs, and aiding in parts availability. There used to be even bigger differences between models (examples would be the Olds 442, The Chevelle SS, And The
Pontiac GTO, all the pinnacles of their models, all shared the same suspension, transmissions, differentials, and chassis.)