I didn’t realize the difference was that basic. Can the fire the same rounds?
They sometimes fire the same round and sometimes they don’t.
The U.S. M1 Carbine fires a much weaker round than the M1 Garand.
On the other hand, during WWI the Germans standard battle rifle had a 29 inch barrel. They produced a shorter version with a 24 inch barrel (98K with the K being short for Karabiner). They were close to identical except for length. Now a 24 inch rifle would be considered pretty long.
The Spanish issued a carbine which was chambered for the 9mm Largo which is a pistol round. It was called the Destroyer and typically issued to police.
In the case of the M4 carbine and M16 rifle they both chamber and fire the same 5.56 NATO cartridge. That was not the case with the M1 Garand and the M1 carbine.