Designers have to find room somewhere to have a bed that's useful... otherwise you're stuck with a Subaru Brat lol.
For example... comparing a CJ7 to a CJ8 Gladiator it's easy to see where extra room for a bed was found by the AMC designers...
A bit more wheelbase and a lot more overhang.